The Russian foreign ministry on Thursday said it would work diligently to reduce tensions in the Nagorno-Karabakh conflict which flared anew between Armenia and Azerbaijan.

Last week, the two countries engaged in cross-border clashes that left dozens dead on both sides after four days of fighting.

A weak ceasefire is currently in force, but both sides have accused each other of violations.

Russia says it wants to capitalize on the ceasefire and develop it into a workable solution that prevents further outbreaks of hostilities.

Both Armenia and Azerbaijan are former Soviet republics.

“The contacts between Moscow and the parties (of the conflict) were carried out at all levels; we tried to help our friends and we hope that the cease-fire will be maintained,” Lavrov said at a press conference with his Azerbaijani and Iranian counterparts in tow.

“The situation requires working out confidence-building measures on the line of contact and looking back to the previous agreement reached during the talks,” he added.

Armenia and Azerbaijan fought a long war over the Nagorno-Karabakh region soon after the Soviet Union dissolved in 1991. By the time hostilities ended with a ceasefire in 1994, more than 25,000 people had been killed.

Since then, the Armenian military has been in control of Azerbaijani territory in Nagorno-Karabakh.

In 2014, a brief flare-up along the border ended after dozens of soldiers were killed on both sides.

In a parallel effort and part of Moscow’s shuttle diplomacy, Russian Prime Minister Dmitry Medvedev met with his Armenian counterpart Hovik Abrahamyan on Thursday and said that Russia is ready to become a mediator in the conflict.

“This situation certainly causes our extreme concern. It is essential to prevent the conflict from evolving into the hot phase, because this might have the most tragic consequences for the region,” Medvedev said in remarks carried by the Russian TASS news agency.