The US says there has already been a decrease in violence in the city, where dozens have died in clashes this week.
The Syrian military said it would abide by a 48-hour ceasefire starting from 01:00 Thursday (22:01 GMT Wednesday).
The US and Russia brokered a nationwide cessation of hostilities in February but it has come under severe strain.
The agreement does not include so-called Islamic State nor the al-Qaeda-affiliated Nusra Front.
US Secretary of State John Kerry welcomed the new agreement.
"We expect all of the parties to the cessation of hostilities to fully abide by the cessation in Aleppo. That means the regime and the opposition alike," he said.
US state department spokesman Mark Toner said the cessation of hostilities had actually started early on Wednesday, adding: "There has been a decrease in the fighting, in the violence... specifically in Aleppo, but it has not been, of course, complete."
UN envoy for Syria Staffan de Mistura said a failure of the overall cessation of hostilities would be "catastrophic" and could see 400,000 more people heading for refuge at the Turkey border.
The fighting in Aleppo early this week has been the most intense there for more than a year.
Dozens of people were reported to have been killed in fierce clashes, with almost 300 dead over the past two weeks.
The Syrian Observatory for Human Rights said rebels advanced into government-held western districts on Tuesday night but were pushed back by Wednesday morning.
A coalition of rebel groups fighting under the name "Fatah Halab" (Aleppo Conquest) launched the assault on the government's defensive lines in the west of the city on Tuesday by detonating a tunnel bomb, the AFP news agency reported.
Intense gun battles, air strikes and artillery attacks went on through Tuesday night.
UN humanitarian adviser Jan Egeland complained later on Wednesday that the government was still refusing to allow aid deliveries to hundreds of thousands of people in besieged areas of Syria, including rebel-held eastern Aleppo.
Russia meanwhile said it had withdrawn about 30 aircraft from its airbase in Syria.
The Russian military began the withdrawal of most of its forces from Syria in March, six months after launching an air campaign to bolster President Bashar al-Assad.
A partial, shaky truce between Syria and non-jihadist rebels has been extended to the embattled city of Aleppo, after US and Russian pressure.