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-Qaida.

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.

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.

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-Qaida'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.

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.

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.