Azerbaijan and Armenia have accused each other of violating the fragile cease-fire along their border.
Azerbaijan's Defense Ministry said on July 12 that two of its soldiers were killed after Armenian forces attacked its positions.
The ministry said in a statement that Armenia's "offensive" from its northern Tavush region was met with a "counterstrike."
"Two Azerbaijani servicemen were killed and five more wounded," the statement added.
Meanwhile, Armenian Defense Ministry spokeswoman Shushan Stepanian accused Baku of "using artillery in an attack aimed at capturing [Armenian] positions."
"They were repulsed, suffering losses in manpower. There were no casualties among Armenian servicemen," Stepanian said in a Facebook post.
The two neighbors have been locked in a conflict over Azerbaijan's breakaway region of Nagorno-Karabakh for years.
But the clashes on July 12 were far from Nagorno-Karabakh and directly between the two nations, which rarely occurs.
The July 12 clashes came days after Azerbaijani President Ilham Aliyev raised the possibility of a new war with Armenia and denounced stalled peace talks.
On July 7, Aliyev threatened to withdraw from negotiations "if they yield no results." He did not provide further details.
Aliyev accused Yerevan of a military buildup along the two countries' border and of "regularly" shelling civilian targets in Azerbaijan.
Mainly Armenian populated Nagorno-Karabakh declared independence from Azerbaijan amid a 1988-94 war that claimed an estimated 30,000 lives and displaced hundreds of thousands of people.
Since 1994, it has been under the control of ethnic Armenian forces that Azerbaijan says include troops supplied by Armenia. The region's claim to independence has not been recognized by any country.
Negotiations involving the Minsk Group of the Organization for Security and Cooperation in Europe (OSCE), co-chaired by Russia, the United States, and France, helped forge a cease-fire in the region, which is not always honored, but have failed to produce a lasting settlement of the conflict.