SAN'A, Yemen - Yemen's embattled president and the country's most powerful tribal leader agreed Saturday to end five days of gun battles that killed 124 people and pushed the country's political crisis closer to civil war.

The fighting between forces loyal to both men made the last week the deadliest since mass street protests demanding an end to President Ali Abdullah Saleh's 33-year rule broke out three months ago. Although it could prevent bloodshed, the agreement will do little to solve the wider crisis, with Saleh rejecting efforts to negotiate his exit.

The week's battles began when Saleh's security forces attacked the home of Sheikh Sadeq al-Ahmar, head of the powerful Hasid tribal confederation and an uneasy ally who abandoned the president and joined his opponents. Tribal fighters came to Ahmar's defense and seized a number of government buildings in the Hassaba neighborhood of the capital, San'a, during intense clashes.

Fighting then spread outside the capital when tribal fighters seized two army posts north of the city on Friday.

A member the committee of tribal leaders who brokered Saturday's deal said the sides had agreed to withdraw their forces from the neighborhood starting Sunday morning.

The mediation committee will take control of the government buildings seized by tribal fighters so civilians can return to the area, the mediator said.

An aide to Ahmar confirmed the agreement's details.

"The committee reached an agreement, and we will abide by it," he said.

Both spoke on condition of anonymity because they were not authorized to talk to the media.

The agreement late Saturday followed steps by each side to undermine the other, with Ahmar calling on security forces to desert the president and Yemeni authorities issuing an arrest warrant for the tribal leader.

In a letter to security forces, Ahmar called on the Republican Guard and other security forces to help "get rid of this regime and be among the makers of the change that the people are calling for."

It remains unclear whether Ahmar's letter will have any effect. Much of Saleh's power base is made up of childhood friends and relatives he put in high-level security posts, decreasing the chances of defection.

Experts say the uprising's future will be determined by the number of tribes and security forces that turn against Saleh. Many already have, including the Hashid confederation, to which Saleh's tribe belongs. Some army units have also left Saleh to back the protesters, though they did not join the fight against his forces.

The wave of defections picked up after Saleh intensified a crackdown that has killed more than 150 demonstrators.