It's the deadliest clash since the end of last year's war between the two countries in Nagorno-Karabakh.
Three Armenian soldiers were killed in clashes with Azerbaijani forces on the border, Armenia's government said on Wednesday, in the deadliest clash since the end of last year's war in Nagorno-Karabakh.
The Armenia Defense Ministry said in a statement that a further four soldiers were wounded by gunfire.
In a statement issued at 09.20 am local time (07.20 CEST), it added that "fighting continues". About an hour later, Armenia authorities announced that "an agreement restoring the ceasefire at the line of contact" had been reached "at the mediation of the command of Russian peacekeeping forces".
Azerbaijan's Defence Ministry said two of its soldiers were also injured in the clashes but that "there is no danger to their life."
Both countries blamed each other for the flare-up in tension along the border.
Washington said in a statement that it "condemns the recent escalation of violence" and urged the two sides to "uphold their ceasefire by taking immediate steps to de-escalate the situation."
"Continued tensions along the Armenia-Azerbaijan border underscore the fact that only a comprehensive resolution that addresses all outstanding issues can normalise relations between the two countries and allow the people of the region to live together peacefully," it added.
Yerevan and Baku fought a deadly 44-day war in the autumn over Nagorno-Karabakh which ended in November with a Russian-brokered truce.
Tensions between the two countries over the region have been simmering since the end of a war in the 1990s and last year's escalation of violence was the deadliest in two decades. More than 5,000 people lost their lives and tens of thousands were displaced.
The peace deal brokered by Moscow saw Armenia forced to cede significant territory to Azerbaijan.
Both countries have repeatedly accused each other of violating the terms of the agreement since it came into force on November 10.