The US and Russia have agreed on a new ceasefire for Syria that will take effect on Saturday.

Syria's warring government and rebels still need to accept the deal.

The timeline for a hoped-for breakthrough comes after the former Cold War foes, backing opposing sides in the conflict, said they had finalised the details of a "cessation of hostilities" between President Bashar Assad's government and armed opposition groups after five years of violence that has killed more than 250,000 people.

The truce will not cover the Islamic State group, the al Qaida-linked Nusra Front and any other militias designated as terrorist organisations by the UN Security Council.

But where in Syria the fighting must stop and where counter terrorism operations can continue must still be addressed. And the five-page plan released by the US State Department leaves open how breaches of the ceasefire will be identified or punished.

The announcement came after Presidents Barack Obama and Vladimir Putin spoke by telephone, capping weeks of intense diplomacy to stem the violence so that Assad's government and "moderate" rebel forces might return to peace talks in Geneva.

A first round of indirect discussions collapsed almost immediately this month amid a massive government offensive backed by Russian airstrikes in the northern Syria.

Obama welcomed the agreement in the call with Putin that the White House said was arranged at the Russian's request. The White House said Obama emphasised the key is to ensure that Syria's government and opposition groups faithfully implement the deal.

"This is going to be difficult to implement," said White House spokesman Josh Earnest. "We know there are a lot of obstacles, and there are sure to be some setbacks."

Putin called the agreement a "last real chance to put an end to the many years of bloodshed and violence". Speaking on Russian television, he said Moscow would work with the Syrian government, and expects Washington to do the same with the opposition groups that it supports.

UN Secretary-General Ban Ki-moon also welcomed the agreement, saying it is "a long-awaited signal of hope to the Syrian people". But he warned that much work lies ahead for its implementation.

The leader of a Saudi-backed Syrian opposition alliance said in a statement that rebel factions have agreed "in principle" to an internationally mediated temporary truce. Riad Hijab did not elaborate but urged Russia, Iran and the Assad government to end attacks, lift blockades and release prisoners held in Syria.

Syrian officials said the government was ready to take part in a truce as long as it is not used by militants to reinforce their positions.

Both sides have until Friday to formally accept the plan.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.