Egyptian former prime minister Kamal Ganzouri accepted a request from the ruling generals to form a new government on Thursday, state newspaper Al Ahram said on its website. Ganzouri confirmed he had agreed in principle to lead a national salvation government after meeting with the head of the ruling army council, Field Marshal Mohamed Hussein Tantawi, Al Ahram cited sources close to Ganzouri as saying. Ganzouri's appointment came after Egypt's military rulers apologized Thursday for the deaths of dozens of pro-democracy protesters and vowed to prosecute those responsible in its latest attempt to appease the tens of thousands who have taken to the streets demanding that the generals immediately step down. Police and protesters also agreed to a truce negotiated by Muslim clerics after five days of fierce street battles that have left nearly 40 dead. The streets where the battles took place were almost entirely covered by debris, soot, abandoned shoes and scores of the surgical masks used by the protesters to fend off the police's tear gas. The fighting around Cairo's central Tahrir Square, which began Saturday, has been the longest spate of uninterrupted violence since the 18-day uprising that toppled longtime authoritarian leader Hosni Mubarak on Feb. 11. It has deepened the country's economic and security woes ahead of the first parliamentary elections since Muabrak's regime was toppled. Voting is scheduled to begin on Monday. The military statement came two days after Field Marshal Hussein Tantawi, the head of the military council that assumed control of the country after Mubarak stepped down, promised in a televised address to hold a presidential election in the first half of next year but did not offer an apology for the killings. The Supreme Council of the Armed Forces, as the military's ruling body is known, promised to do everything possible to stop the repeat of the deadly events. Army troops, meanwhile, have used metal bars and barbed wire to build barricades to separate the protesters and the police on side streets leading from Tahrir to the nearby Interior Ministry. Most of the fighting took place on those streets. The truce came into force around 6 a.m. and was still holding by late morning. It was negotiated by Muslim clerics at the site. Protesters formed a series of human chains on the side streets to prevent anybody from violating the truce or approaching flashpoint areas close to the police lines. “If any of you hurl a single rock, we will beat you to death,” a young man warned, addressing angry young men who wanted to resume fighting. Others pleaded for calm, chanting “peaceful, peaceful.” The military's handling of the transitional period has been intensely criticized by rights groups and activists, who suspect the generals want to keep power even after a new parliament is seated and a new president is elected. The Health Ministry raised its nationwide death toll since Saturday to 37, while the Elnadeem Center, an Egyptian rights group known for its careful research of victims of police violence, has said 38 were killed. The clashes also have left at least 2,000 protesters wounded, mostly from gas inhalation or injuries caused by rubber bullets fired by the security forces. The police deny using live ammunition.