MOSCOW — A Russian submarine in the Mediterranean fired cruise missiles at al-Qaida-linked militant positions in northwestern Syria on Friday, a day after militants wounded three Russian troops in the area, the defense ministry said in Moscow.

The ministry said the missiles strikes from the Veliky Novgorod submarine earlier in the day targeted militants, ammunition depots and fortifications in Syria’s northwestern Idlib province, which is dominated by the al-Qaida-linked Levant Liberation Committee.

Russia has been a main backer of Syrian President Bashar Assad and joined the country’s war two years ago, tipping the balance of power in favor of the government.

On Thursday, three Russian troops were wounded after militants encircled 29 Russian military officers deployed outside of Idlib for several hours. The Russian troops repelled the attack with the help of local tribes, the Russian ministry said.

Over the past weeks, Russia has fired cruise missiles from the Mediterranean toward positions of the Islamic State group in the eastern province of Deir el-Zour but attacks on Idlib have been rare.

Moscow said the Kalibr missiles destroyed command centers and a training base of the militants who had attacked members of the Russian military police in Hama province earlier this week.

The Russian defense ministry said the missiles were fired at 10.11 a.m. local time from the Mediterranean at targets 300 kilometers (187 miles) away. Russia targeted militants, armored vehicles, ammunition depots and fortifications of al-Qaida’s Syria branch in Idlib.

“Surprise missiles strikes in Idlib province destroyed important command posts, training bases and armored vehicles of the terrorists who took part in an attempt to capture 29 Russian military policemen in southern Hama province,” the ministry statement said, citing intelligence reports.