Armenian President Serzh Sarkisian described the bloodshed as the “largest-scale hostilities” since a 1994 truce ended a war in which Armenian-backed fighters seized the territory from Azerbaijan.
He said 18 Armenian troops were killed and some 35 wounded in the fighting.
Azerbaijan’s defence ministry said 12 of its soldiers were killed and one of its military helicopters was shot down.
Moscow and Western leaders called for an immediate ceasefire along the Karabakh frontline.
Russian President Vladimir Putin called on the two former Soviet states to “exercise restraint in order to prevent further casualties”, Kremlin spokesman Dmitry Peskov said.
European Union foreign policy chief Federica Mogherini said the reports of heavy fighting were “deeply worrying”.
Armenia accused Azerbaijan of launching a “massive attack along the Karabakh frontline using tanks, artillery, and helicopters” on Friday night.
Azerbaijan, however, said it defended itself after coming under fire from “large-calibre artillery and grenade-launchers”.
The state’s defence ministry spokesman Vagif Dargahli said fighting had ended on Saturday evening, but warned that the situation remained highly volatile.
Armenian separatists, backed by the capital Yerevan, seized control of the mountainous Nagorny Karabakh region in the early 1990s war that killed 30,000 people.
The two nations have never signed a peace deal despite the 1994 ceasefire. The region is still internationally recognised as part of Azerbaijan.
Moscow has supplied weapons to both sides, but is much closer to Armenia.
Turkish President Recep Tayyip Erdogan expressed “solidarity” with energy-rich Azerbaijan, whose military spending has in the past exceeded Armenia’s entire state budget.
Azerbaijan has repeatedly threatened to take back the breakaway region by force if negotiations fail to yield results.
Moscow-backed Armenia says it could crush any offensive.
The last flare-up took place in November 2014 when Azerbaijan shot down an Armenian military helicopter.