CAIRO (Agencies) - Egypts military rulers apologised on Thursday for the deaths of demonstrators at the hands of police as a truce brought calm back to the outskirts of Cairos Tahrir Square, scene of days of deadly clashes. An agreement has been reached between security forces and protesters to halt confrontations between the two sides, the cabinet said in a statement on Facebook. At least 39 protesters have been killed since Saturday when clashes erupted and more than 2,000 injured, prompting expressions of concern from Western governments and a UN call for an independent inquiry into the excessive use of force. The Supreme Council of the Armed Forces presents its regrets and deep apologies for the deaths of martyrs from among Egypts loyal sons during the recent events in Tahrir Square, it said in a statement on its Facebook page. The council also offers its condolences to the families of the martyrs across Egypt. Demonstrators again camped out overnight in Tahrir Square to demand the military leadership step down immediately. Troops set up barricades during the night on Mohammed Mahmud Street, a flashpoint thoroughfare linking Tahrir with the heavily fortified interior ministry. An army general pleaded with protesters to head back to the square the symbolic heart of the uprising that toppled veteran president Hosni Mubarak in February. There are two fronts now: Mohammed Mahmud and Tahrir. We need to resolve what is happening in Mohammed Mahmud and go back to the square so we can focus on our goal of toppling the field marshal, said protester Sameh Mahmud, a 35-year-old lawyer. At the entrance to Tahrir, protesters had set up their own barricades, applauding those returning from Mohammed Mahmud. Since Friday, Egyptians have converged on the square to demand the end of military rule and the ouster of Field Marshal Hussein Tantawi, Mubaraks long time defence minister now in charge of the country. The mass protests, which placatory moves by the military have failed to dampen, threaten to eclipse the first post-Mubarak parliamentary elections due to begin on Monday. The armys apology came after a speech by Tantawi on Tuesday which was aimed at appeasing protesters in the square but was heavily criticised for not making mention of the deaths at the hands of police. The SCAF vowed to investigate and prosecute all those behind the deaths. It also pledged to offer assistance to the families of the dead and injured, and to set up a military field hospital in Tahrir. The protest deaths prompted an unusually strongly worded statement from Al-Azhar, Sunni Islams highest seat of learning, calling on police not to shoot at demonstrators. Grand imam Sheikh Ahmed al-Tayyeb said that any dialogue stained with blood is doomed and its fruit will be bitter. Al-Azhar calls on the police leadership to immediately issue orders not to point their weapons at demonstrators... no matter what the reasons, Tayyeb said in a message aired on state television. It calls on the armed forces to throw all their weight behind preventing confrontations between one people, he added. Three people died in clashes with police in and around Tahrir on Wednesday, a medic said. A fourth was shot dead in the northwestern city of Mersa Matruh when security forces clashed with demonstrators trying to storm a police station, state media said.