Russian President Vladimir Putin, left, speaks with Defense Minister Sergei Shoigu at the Kremlin on Dec. 29. (Michael Klimentyev/AFP/Getty Images)

A cease-fire announced by the Syrian government went into ­effect across the country early Friday as part of a broader deal that includes a return to peace talks to end more than five years of war.

Forces loyal to Syrian President Bashar al-Assad reestablished control over the northern city of Aleppo earlier this month, forcing rebels to flee what was once their largest stronghold and handing the government a victory that appeared to bring the war’s endgame into view.

The Assad government, backed by Russia and Iran, is now in its strongest position since the start of the war, while rebel groups are mostly boxed into the northwestern province of Idlib and hold no strategically significant urban areas.

The Syrian military declared in a statement issued Thursday that the “comprehensive” cessation of hostilities follows “victories and advances” by the armed forces.

The cease-fire was reported to be generally holding Friday, despite some relatively minor violations. The Syrian Observatory for Human Rights, a Britain-based monitoring group, said clashes occurred early Friday between government troops and rebels in Hama province and near Damascus but that no civilian casualties were reported. The group also said Syrian warplanes carried out at least 16 airstrikes Friday against rebels in Hama.

Russia and Turkey, which brokered the deal, said they could guarantee compliance from the government and its armed opposition, respectively, after weeks of negotiations.

In Ankara, Turkish President Recep Tayyip Erdogan called the agreement a “historic opportunity” that should not be squandered. But in Moscow, Russian President Vladimir Putin acknowledged it was “fragile.”

The agreement marks an ambitious venture by the Russian leader to establish himself as the dominant dealmaker in the Syrian conflict and further sideline the United States less than a month before President-elect Donald Trump’s inauguration.

The Syrian army said the cease-fire excluded “terrorist organizations,” notably the Islamic State but also the country’s al-Qaeda affiliate, an influential component of what remains of Syria’s armed opposition. The caveat suggested that the fighting could continue in Idlib, now the rebels’ final bastion.

Speaking in a televised meeting with his defense and foreign ministers Thursday, Putin said three documents were signed: the cease-fire to begin Friday between the Syrian government and certain rebel groups, an agreement on monitoring the truce and a statement of readiness to begin peace talks.

The State Department said it had played no part in the negotiations but called news of the cease-fire a “positive development.” Mark Toner, a department spokesman, said, “We hope it will be implemented fully and respected by all parties.”

As President Obama prepares to leave office next month, Washington’s influence in Syria is much diminished. Russia and Turkey have taken the lead on initiatives to end a war that has killed almost half a million people, spurred the largest refugee crisis since World War II and given safe haven to a global terrorist threat in the form of the Islamic State.

Russian Foreign Minister Sergei Lavrov did not mention Obama in his remarks, instead inviting the incoming Trump administration to join the process after the president-elect’s inauguration.

“I would also like to express my hope that when the administration of Donald Trump assumes its responsibilities, they may also join these efforts in order to work toward this goal in a friendly and collective manner,” Lavrov said during the meeting.

Trump has signaled his willingness to work with Moscow on a solution to the Syrian conflict. He is also on record as supporting policies that include a withdrawal of support for the armed opposition and the establishment of “safe zones” for civilians. 

The intervention of Russia’s air force last year transformed the Syrian government’s fortunes, quashing a major rebel offensive and turning the war in Damascus’s favor. Although Russia later announced a partial withdrawal, its air and ground forces continue to play an important role, even as the influence of Assad’s other main backer, Iran, rises.

Russian Defense Minister Sergei Shoigu said seven opposition groups with a combined 60,000 fighters from central and northern Syria have agreed to the cease-fire, including Ahrar al-Sham and Jaish al-Islam, two powerful Islamist factions.

The exclusion of groups linked to the Islamic State and al-Qaeda seemed to be the latest attempt to peel jihadist fighters from more-moderate elements in the armed opposition.

The al-Qaeda-linked Jabhat Fatah al-Sham, formerly called Jabhat al-Nusra, contributes significant firepower to a coalition of rebel groups in Idlib province. U.S. officials say it may be difficult to separate the extremists fighting alongside a number of key rebel groups.

Previous cease-fires have been short-lived. A similar deal announced by the United States and Russia in February lasted longer than most but was over by July. A U.S.-Russian deal in September lasted a week.

The Syrian National Coalition, a leading political opposition group based in Turkey, confirmed its support for the truce. A senior official, Hadi al-Bahra, described it in a message posted to Twitter as “a positive achievement,” saying his group would “make sure that this agreement will be implemented fully.”

But as diplomacy continued, so did the fighting. A Syrian rescue group known as the White Helmets said Thursday that at least 12 people were killed and 27 injured in airstrikes and artillery shelling on civilian homes in Eastern Ghouta, a Damascus suburb. Footage from the area showed an elderly man being carried to an ambulance, his blood-soaked scarf streaking the vehicle as his stretcher was placed inside.

Peace efforts in Syria must still survive the many potential pitfalls of the shaky alliance between Russia and Turkey. But if Putin’s gambit to play peacemaker among the bitter regional ­rivals of the Middle East is successful, it would mark his greatest international achievement to date. To broker a solution to the region’s bloodiest conflict while excluding the United States would be an important shift in the international balance of power — one that Putin has called for publicly since he took power in 2000.

Heba Habib in Stockholm contributed to this report.