MOSCOW (Reuters) - Russia said it would continue selling arms to both Azerbaijan and Armenia despite the latest flare-up of the conflict over Nagorno-Karabakh, angering the Armenians who consider Moscow a close ally.

An ethnic Armenian soldier stands next to a cannon at the artillery positions near Nagorno-Karabakh's town of Martuni, April 8, 2016. REUTERS/Staff

Renewed fighting around Armenian-backed Nagorno-Karabakh, which broke out last weekend, was the most intense since a 1994 ceasefire that stopped the conflict around the rebel region but did not resolve the underlying dispute.

A Moscow-brokered ceasefire agreed on Tuesday stopped the outburst of violence in which Azerbaijan and the Armenia-backed rebel region lost dozens of their servicemen.

On Saturday, after the ceasefire went into effect, the Vatican announced that Pope Francis would visit Azerbaijan and Georgia from September 30 to October 2. He is due to travel to Armenia on June 24-26.

Russia plays an important role in the region as its former imperial and Soviet-era overlord. It is also the main seller of weapons to both Armenia, a close Moscow ally, and Azerbaijan, which has developed warm relations with ethnically kin Turkey.

Russian Prime Minister Dmitry Medvedev, who travelled to both Armenia and Azerbaijan this week in a display of Moscow’s lead role in mediating in the conflict, said Russia had no intention of halting arms sales to any side of the conflict.

“If we imagine for a minute that Russia has given up this role (of arms seller), we well understand that this place will not stay vacant,” Medvedev told the weekly “Vesti on Saturday” programme on Russian state TV.

“They will buy weapons in other countries, and the degree of their deadliness won’t change in any way,” he said. “But at the same time, this could ... destroy the existing balance of forces (in the region).”

Armenian Prime Minister Hovik Abrahamyan decried on Saturday Russia’s continued arms supplies to Azerbaijan.

“Russia is our strategic partner, and our people take it with pain that Russia sells weapons to aggressor Azerbaijan,” the government press service quoted him as saying after a church funeral service for a soldier killed in clashes with Azeri forces.

Nagorno-Karabakh is a mountainous enclave within Azerbaijan’s borders, populated mainly by ethnic Armenians who reject Azerbaijan’s rule. With support from Armenia, they fought a war in the early 1990s to establish de facto control over the territory.

Russia’s active diplomacy has overshadowed the United States, which has extensive interests in the South Caucasus region that includes Azerbaijan and Armenia.

While the leaders of Azerbaijan and Armenia maintain their bellicose rhetoric, Moscow believes the possible involvement of other major arms exporters to the region “will most likely complicate the situation further”.

“I believe weapons may and should be bought not only to be used one day, but to be a deterrent factor,” Medvedev said. “This aspect must be considered by both sides of the conflict.”

(This version of the story was refiled to remove extra characters)