BEIRUT, Lebanon (The New York Times)— Russia signed a long-term agreement on Friday to greatly enlarge its military presence in Syria, more than doubling the space for warships in Russia’s only Mediterranean port and securing rights to an air base that may already be adding a second runway.

The agreement covers the port in Tartus and an air base near Latakia, which have been pivotal in Russian assistance to President Bashar al-Assad in fighting an array of insurgents. It ensures Russia’s ability to deploy forces in Syria for the next half-century and perhaps beyond.

News of the agreement came as Mr. Assad received what appeared to be another positive development — a Turkish official suggested publicly for the first time that Turkey would accept a peace deal in Syria’s six-year-old war that would allow Mr. Assad to stay in power.

The remarks by the official, Deputy Prime Minister Mehmet Simsek, at the World Economic Forum in Switzerland, indicated that Turkey — Syria’s northern neighbor and one of Mr. Assad’s most implacable foes — had softened its position in the interest of finding a solution.

While Turkey’s government later said that Mr. Simsek’s remarks had been misconstrued, it was clear that he had said a settlement without Mr. Assad would be “not, you know, realistic.”

Both developments came as Russia, Turkey and Iran prepared to convene Syrian peace talks in Astana, the capital of Kazakhstan, beginning Monday.

For the first time, it looked likely that the main Syrian opposition, along with many other factions, would sit down with Mr. Assad’s regime for peace talks. The last effort at Syrian peace negotiations was held by the United Nations in Geneva in February, and it collapsed in days.

The new Russian military agreement with Syria provides for an expansion of Russia’s Tartus naval base on the Syrian coast under a 49-year lease that could automatically renew for a further 25 years, according to Tass, the Russian news agency.

Tass said the expansion would provide simultaneous berthing for up to 11 warships, including nuclear-powered vessels, more than doubling its present known capacity there.

Tass reported that the agreement also provided for a similar long-term commitment for the Russians to use the Khmeimim Air Base in the Latakia area, which the Russians built in 2015 as they mobilized to help Mr. Assad’s forces.

There were news reports that the Russians were building a second runway at the air base.

The military agreement came despite Russia’s announcement this month that it was drawing down its forces in Syria after successes by the Assad government against Syrian rebels, which were achieved with much help from the Russians.

The rebels were ousted from their strongholds in Aleppo, once Syria’s largest city, late last year, partly because of Russian air support.

The Russian-Syrian agreement came as momentum grew among dissidents to join the peace talks in Astana, although it was a foregone conclusion that any agreement from those talks would be rejected by jihadi factions like the al-Nusra Front and the Islamic State. At least 14 rebel factions are participating.

At Turkish government insistence, however, Kurdish groups fighting the Islamic State in the east of the country and backed by the United States were not invited. Turkey’s government has accused those Kurdish groups of affiliations with militant Kurdish separatists in Turkey.

Mr. Simsek’s remarks were made at a World Economic Forum session titled “Syria and Iraq: Ending the Conflict.” He suggested Turkey would accept continued rule by Mr. Assad.

“As far as our position on Assad is concerned,” Mr. Simsek said, “we think that the suffering of the Syrian people and the tragedies, clearly the blame is squarely on Assad,” he said. “But we have to be pragmatic, realistic. The facts on the ground have changed dramatically, and so Turkey can no longer insist on, you know, a settlement without Assad, and it’s not, you know, realistic. We just have to work with what we have.”

Hours later, Mr. Simsek’s office in Ankara issued a statement saying news accounts had distorted Mr. Simsek’s remarks and “tried to create the perception that our deputy P.M. said, ‘Turkey cannot insist anymore on an agreement without Assad.’” But a review of the videotape of the session left no doubt that that was what he had said.

The Astana talks are the outcome of a Russian-brokered cease-fire throughout Syria that began Dec. 30. It has been widely observed except in areas where extreme jihadi factions prevail — but with many accusations of breaches elsewhere as well.

“The priority for us is to put an end to human tragedy, human suffering in Syria and Iraq,” Mr. Simsek said in Davos. “The process is to make sure we translate the current lull into a more lasting cease-fire and then talk about more mundane stuff of settling the conflict.”

Russia is the lead host of the talks in the Kazakh capital, with support from Turkey and Iran. Over the last week, Turkey and Russia have also invited the United States and the United Nations to attend the Astana negotiations.