GENEVA - The United States and Russia announced early Saturday a breakthrough agreement on Syria that foresees a nationwide cease-fire starting early next week, followed by an unlikely new military partnership between the rival governments targeting the Islamic State and al Qaeda.

U.S. Secretary of State John Kerry said the plan could reduce violence in Syria and lead to a long-sought political transition, ending more than five years of bloodshed. He called the deal a potential “turning point” in a conflict that has killed as many as 500,000 people, if complied with by Syria’s Russian-backed government and U.S.-supported rebel groups.

The cease-fire begins at sundown Monday, Kerry said, coinciding with the Muslim Eid al-Adha holiday.

Get Breaking News Delivered to Your Inbox

Kerry’s negotiating partner, Russian Foreign Minister Sergey Lavrov, confirmed the agreement and said it could help expand the counterterrorism fight and aid deliveries to Syrian civilians. He said Syrian President Bashar Assad’s government was prepared to comply.

“This is just the beginning of our new relations,” Lavrov said.

The deal culminates months of frenetic diplomacy that included four meetings between Kerry and Lavrov since Aug. 26. The arrangement hinges on Moscow pressuring Assad’s government to halt all offensive operations against Syria’s armed opposition and civilian areas. Washington must persuade “moderate” rebels to break ranks with the Nusra Front, al Qaeda’s Syria affiliate, and other extremist groups.

Both sides have failed to deliver their ends of the bargain over several previous truces.

But the new arrangement goes further by promising a new U.S.-Russian counterterrorism alliance, only a year after President Barack Obama chastised Russia for a military intervention that U.S. officials said was mainly designed to keep Assad in power and target more moderate anti-Assad forces.

Russia, in response, has chafed at America’s financial and military assistance to groups that have intermingled with the Nusra Front on the battlefield. Kerry said it would be “wise” for opposition forces to separate completely from Nusra, a statement Lavrov hailed.

“Going after Nusra is not a concession to anybody,” Kerry said. “It is profoundly in the interests of the United States.”

The deal includes intelligence sharing and targeting coordination, a level of U.S.-Russian interaction that has upset several leading national security officials in Washington, including Defense Secretary Ash Carter and National Intelligence Director James Clapper. The joint military work would only begin after several days of adherence to the new cease-fire.

Kerry appeared at the news conference after several hours of internal U.S. discussions.

At one point, Lavrov said he was considering “calling it a day” on talks, expressing frustration with what he described as an hours-long wait for a U.S. response. He then presented journalists with several boxes of pizza, saying, “This is from the U.S. delegation,” and two bottles of vodka, adding, “This is from the Russian delegation.”

The Geneva negotiating session, which last more than 13 hours, underscored the complexity of a conflict that includes myriad militant groups, shifting alliances and the rival interests of the U.S. and Russia, Saudi Arabia and Iran, and Turkey and the Kurds.

Getting Assad’s government and rebel groups to comply with the deal may now be more difficult as fighting rages around the divided city of Aleppo, Syria’s most populous and the new focus of a war that has killed as many as 500,000 people.

Assad’s government appeared to tighten its siege of the former Syrian commercial hub in the last several days, seizing several key transit points. Forty days of fighting in Aleppo has killed nearly 700 civilians, including 160 children, according to a Syrian human rights group. Volunteer first responders said they pulled the bodies of nine people, including four children, from rubble following air raids Friday on a rebel-held area.

Kerry outlined several steps the government and rebels would have to take. They must now pull back from demilitarized zones, and allow civilian traffic and humanitarian deliveries.

But as with previous blueprints for peace, Saturday’s plan appears to lack enforcement mechanisms. Russia could, in theory, threaten to act against rebel groups that break the deal. But if Assad bombs his opponents, the U.S. is unlikely to take any action against him given Obama’s longstanding opposition to entering the civil war.

In addition to those killed, Syria’s conflict has chased millions of people from their homes, contributing to Europe’s worst refugee crisis since World War II. Amid the chaos of fighting between Syria’s government and rebels, the Islamic State group has emerged as a global terror threat.