Fighting has continued in the disputed region of Nagorno-Karabakh, with Azerbaijan saying three of its troops were killed in the past 24 hours and both sides ramping up their rhetoric.

Armenian President Serzh Sargsyan warned on Monday that his country could formalise ties with Nagorno-Karabakh by officially recognising it as independent if the fighting escalates.

He warned that any such escalation could lead to a "large-scale war".

Azerbaijan's defence ministry said that if Armenian-backed forces continued to fire on civilians near Nagorno-Karabakh, its army would prepare to attack the region's capital, Stepanakert.

The fighting that erupted on Saturday was the worst since a war that ended in 1994, leaving Nagorno-Karabakh under the control of local ethnic Armenian forces and the Armenian military.

Hikmet Hajiyev, a spokesman for Azerbaijan's foreign ministry, told Al Jazeera on Monday that Armenian forces continued to shell residential areas despite a unilateral ceasefire announced by Baku.

"For more than 20 years we have had a ceasefire and the ceasefire was always relative. But in such a situation as yesterday Azerbaijani armed forces declared that we are holding all counter measures but the Armenian side are still attacking Azerbaijan civilians.

"In such circumstances Azerbaijan armed forces are compelled to take all necessary precautionary measures to guarantee the security of Azerbaijan civilians, and also to deter Armenia from further acts of aggression and provocation - therefore all responsibility lies on the republic of Armenia for taking such kind of provocative steps," Hajiyev told Al Jazeera over the phone from Baku.

READ MORE: Armenia accuses Azerbaijan of all-out 'war'

Artsrun Ovannisian, the Armenian Defence Ministry spokesman, said that the Karabakh militia advanced overnight, "liberating new positions".

He said that the Armenian artillery hit Azerbaijani units as they were moving to the frontline.

Armenian forces also occupy several areas outside Nagorno-Karabakh proper.

International efforts to settle the conflict, fuelled by long-simmering tensions between Christian Armenians and mostly Muslim Azeris, have brought no results.

READ MORE: Azerbaijan calls unilateral truce in Nagorno-Karabakh

At least 30 troops were killed on both sides on Saturday as the warring parties used heavy artillery and rocket systems. A civilian boy was also killed.

Self-proclaimed officials in Karabakh said fighting intensified in the morning in the southeast and northeast with the Azerbaijani troops using Grad multiple rocket launchers.

In Moscow, President Vladimir Putin's spokesman Dmitry Peskov said the Kremlin was "seriously worried" about the continuing fighting in the region and added that Russia will continue its efforts to ensure a cease-fire.