Moscow (AFP) - Russia and Syria in August signed an agreement giving Moscow the go-ahead for an open-ended military presence in the war-torn country, Moscow has revealed.

The agreement was signed in Damascus on August 26, 2015, more than a month before Russia launched a bombing campaign against the Islamic State group and other "terrorists" at the request of Syria's President Bashar al-Assad.

The Russian government on Thursday released the text of the agreement, which said that it had been "concluded for an open-ended period of time."

Under the terms of the agreement, Russia deployed warplanes and personnel at the Hmeimim airbase in Latakia in Syrian government-held territory.

The deal was made to defend the "sovereignty, territorial integrity and security of the Russian Federation and the Syrian Arab Republic," according to the document.

President Vladimir Putin justified the campaign launched in September -- Russia's first major foreign intervention since the Soviet Union's invasion of Afghanistan in 1979 -- by saying that Moscow needed to target Islamic State fighters before they crossed into Russia.

Military analyst Alexander Golts said the agreement with Syria suited Russia's interests.

"Russia can halt its operation at any time so it does not have any responsibilities before Syria," he told AFP.

"At the same time it can stay there for as long as it wishes. It's totally up to the Russian authorities."

The West has criticised Russia's foray into the already convoluted, multi-front conflict, accusing Moscow of targeting not only the IS group but also moderate rebels fighting the Assad regime.

Moscow has denied the accusations, claiming it has been supporting anti-Assad armed rebels in the fight against IS.