Armenia says four soldiers have been killed and a fifth wounded, in the first flare-up of violence on the border with Azerbaijan since the two neighbours began talks on a peace deal.
Azerbaijan said it had destroyed an Armenian combat post in the south in retaliation for an earlier incident.
Last year Azerbaijan recaptured its Nagorno-Karabakh region held for decades by ethnic Armenians.
Armenia has now accused its neighbour of trying to escalate tensions.
The attack in Armenia's south-eastern Syunik province also comes days after Azerbaijan's President Ilham Aliyev won a fifth term in office, and local commentators have raised concerns that he may be considering further military action to seize Armenian territory.
The defence ministry in Azerbaijan's capital, Baku, said its attack on the Armenian position near Nerkin Hand came after an Azerbaijani soldier had been wounded few kilometres away on Monday. It also highlighted a separate border incident hundreds of kilometres north, denied by Armenia.
Only recently Azerbaijan's top officials said relations between the two neighbours had become calmer in the past six months.
The foreign ministry in Baku said the "provocation" by Armenia's military and political leaders was a serious blow to the peace process in light of recent stability. It said that because the first shooting took place in areas overseen by the European Union's mission in Armenia, the incident raised "serious concerns about the aims and purposes of this mission".
More than 100,000 ethnic Armenians fled Azerbaijan's military conquest of Karabakh last September. The South Caucasus territory, between the Black Sea and the Caspian Sea, had been recognised internationally as part of Azerbaijan but had been in Armenian hands for more than 30 years.
The latest flare-up has revived suggestions that an emboldened Azerbaijan, backed by Russia, may be trying to force Armenia to open a rail and road route known as the Zangezur corridor through Armenian territory to its exclave of Nakhchivan and possibly Turkey too, before any peace agreement is signed.
Neighbouring Iran is also concerned by Baku's plans to link Turkey to Azerbaijan through Armenia.
Russia has urged the two neighbours to exercise restraint. It has peacekeepers stationed in Karabakh who are due to leave the region next year but the Kremlin is keen to maintain presence in the area.
Armenia has recently distanced itself from its former Russian ally after it failed to prevent Azerbaijan's military recapture of Karabakh. Prime Minister Nikol Pashinyan said this month that Moscow could no longer be considered Armenia's primary defence partner and Yerevan now sees France and India as two of its biggest arms suppliers.
Removing Russia's influence could prove to be a challenging task for Armenia. A significant portion of Armenia's infrastructure, including railroads, gas, and electricity are under Russian control. There is a Russian military base on Armenian territory, and Armenia is a member of both Putin's military and political blocs.
Russia's presence extends to the protection of Armenia's borders with Turkey and Iran through Russian border guards – who also operate at the international airport in Armenia's capital, Yerevan.
Armenia has also been discussing constitutional changes, demanded by Azerbaijan as part of the proposed peace deal, to remove references to the goal of unification with Nagorno-Karabakh from its main law. Baku sees this as a continued legal claim to Azerbaijani territory.
Tens of thousands of Armenians have signed a petition objecting to the constitutional change and Prime Minister Nikol Pashinyan's popularity has declined in Armenia since the military defeat,
Pro-government commentators in Azerbaijan have blamed the flare-up in violence on Armenian opposition voices, rather than the prime minister, suggesting they have influence over some sections of the Armenian armed forces.