At least 30 soldiers were killed as heavy fighting erupted between Armenian and Azerbaijani forces over the separatist region of Nagorno-Karabakh (AP)

Azerbaijan's defence ministry has announced a unilateral ceasefire against the separatist region of Nagorno-Karabakh, a claim that rebel forces there promptly rejected.

Fighting in what was a dormant conflict for two decades flared up over the weekend with a boy and at least 30 troops killed on both sides. Each side blamed the other for Saturday's escalation, the worst since the end of a full-scale war in 1994.

The defence ministry said, in response to pleas from international organisations, it will be unilaterally "suspending a counter-offensive and response on the territories occupied by Armenia". The ministry added it will not focus on fortifying the territory that Azerbaijan has "liberated". It did not elaborate.

Nagorno-Karabakh, a region in Azerbaijan, has been under the control of local ethnic Armenian forces and the Armenian military since a war ended in 1994 with no resolution of the region's status. The conflict is fuelled by long-simmering tensions between Christian Armenians and mostly Muslim Azeris.

Armenian forces also occupy several areas outside Nagorno-Karabakh proper. The sides are separated by a demilitarised buffer zone, but small clashes have broken out frequently.

Officials in the self-proclaimed republic of Nagorno-Karabakh promptly disputed the reports of Azerbaijan's unilateral ceasefire. David Babayan, spokesman for the Karabakh president, said that they had not seen any signs that fighting was suspended.

The defence ministry of Nagorno-Karabakh on Sunday also claimed to have restored control over a strategic area near the front line. It said Nagorno-Karabakh forces went on a counter-offensive around the village of Talish after Azerbaijani forces shelled their positions just before dawn. Two Karabakh troops were reported injured.

It also said Azerbaijan was using rockets, artillery and armour against the region.

Earlier on Sunday, a spokesman for Azerbaijan's defence ministry, Vagif Dargyakhly, said Azerbaijani positions came under fire overnight and that civilian areas also were hit.

On Saturday, Armenia said 18 soldiers were killed and Azerbaijan reported 12 dead.

Turkish president Recep Tayyip Erdogan vowed on Sunday to back its ally Azerbaijan in the conflict, saying that the flare-up could have been avoided if "fair and decisive steps" had been taken.

"We pray our Azerbaijani brothers will prevail in these clashes with the least casualties," he said.

The unresolved conflict has been an economic blow to Armenia because Turkey has closed its border with Armenia.