PRESIDENT Vladimir Putin has visited a Russian military air base in Syria, declaring victory and announcing a partial pullout of forces from the country.

Putin’s surprise visit marked his first trip to Syria, drawing a symbolic line under the campaign that has shored up President Bashar Assad’s government.

It was also the first visit by a foreign head of state to war-ravaged Syria since the violence started nearly seven years ago.

Putin’s brief stop at the Hemeimeem air base in Syria’s coastal province of Latakia while en route to Egypt came days after the Russian president declared his bid to run for re-election on March 18.

It also followed the Russian announcement last week that the Syrian army, with the help of Russian airstrikes, routed the Daesh group in eastern Syria and restored control over the country’s border with Iraq.

In a televised speech to the Russian troops at the base, the Russian leader hailed their “excellent” performance in Syria.

“You have shown the best qualities of a Russian soldier: courage, valour, team spirit, decisiveness and excellent skills,” said Putin.

“The Motherland is proud of you.”

Russia launched its air campaign in Syria at the end of September 2015, when Assad’s government was teetering on the brink of collapse, and quickly changed the course of the conflict in his favour.

Russian officials say troops in Syria were there mainly to fight “terrorists” including Daesh militants and al Qaeda affiliates, but they also heavily targeted other rebel factions opposed to Assad, allowing his troops to claw back significant territory over the past two years.

Putin has hosted Assad twice in the past six years.

Russian television stations showed Putin walking off the plane at the air base, embracing and shaking hands with Assad.

The two then visited a military operations room at the base.

The Hemeimeem base, located in a region that is the heartland of Mr Assad’s Alawite minority, has served as the main foothold for the Russian military campaign in Syria.

“Here in Syria, far away from our borders, you helped the Syrian people to preserve their state and fend off attacks by terrorists,” Putin said, facing the troops lined up on the tarmac.

“You have dealt a devastating blow to those who blatantly threatened our country.

“We will never forget about the victims who fell in the fight against terror both here and in Russia.”

In his speech, Putin also said that he had ordered the military to withdraw a “significant part” of the Russian contingent in Syria.

He added that “if the terrorists again raise their heads, we will deal such blows to them they have never seen”.

Putin, however, said the Russian military will maintain its presence at Hemeimeem and the naval facility in Tartus.

General Sergei Surovikin, the Russian military commander in Syria, reported to Putin that the military will pull out 23 warplanes, two helicopter gunships, special forces units, military police and field engineers.

Syria has allowed Russia to use Hemeimeem air base indefinitely without cost.

After seeing troops march to the tunes of military marches, Putin drove up to the Russian warplanes parked on the runway and talked to the pilots, who said they will fly back home later in the day.

Syrian TV said Assad thanked Putin for his troops’ “effective contribution” to the fight against terrorism in Syria, which he said the Syrian people “will never forget”.

“Syria has been saved as a sovereign, independent state, refugees are coming home and conditions have been created for a political settlement under the United Nations’ auspices,” Putin said.