After the desertion of several hundred of his officers during Hurricane Katrina and the suicide of two he described as close friends, Police Superintendent Eddie Compass announced his retirement Tuesday.

Compass appeared to catch the mayor, City Council and many officers by surprise with his mid-afternoon announcement that he will step down within 45 days.

"I served this department for 26 years and have taken it through some of the toughest times of its history. Every man in a leadership position must know when it's time to hand over the reins," he said at a news conference. "I'll be going on in another direction that God has for me."

With his deputies at his side, Compass did not say what he plans to do next, asking the public to respect his privacy. His deputy, Warren Riley, was named acting superintendent.

From early Tuesday, a steady stream of contractors continued to pour into downtown and the Algiers neighborhood on the west side of the Mississippi River. Mayor C. Ray Nagin, initially criticized for his urgency in reopening the storm-ravaged city, said he hopes to let residents return to several other areas as early as this weekend.

"It is very important for people to come back to the city and take a look and gather whatever resources or mementos or valuables they have, and at least understand the tremendous challenge we have," Nagin said at the first City Council meeting since Katrina struck four weeks ago. Federal officials have suggested that "we shouldn't bring back the music and jazz and red beans and rice and gumbo. I do not buy that."

Nagin praised Compass for carrying the city through such a tumultuous period. "I understand where he is," Nagin said. "He decided to retire on top."

Although Compass was popular and well-regarded, the department's image -- already poor -- suffered through the latest crisis. In the chaotic, violent aftermath of Katrina, a city known for its high crime rate descended into days of anarchy. Hundreds of police officers abandoned their posts, and many were accused of participating in looting that was captured on national television. In several neighborhoods, gangs controlled the streets until the military arrived.

In an appearance on "Oprah," Compass described his dismay and frustration over horrors that he said occurred in temporary shelters set up in the Superdome and convention center.

"The gunfire would come," he said. "We couldn't shoot in the crowd. So my guys would converge on where the flash went and start patting individuals down and take the guns out of their hands with our bare hands."

He later acknowledged he could not account for nearly 500 of the city's 1,700 police officers and that at least 259 would face disciplinary hearings for alleged desertion during the crisis.

Many others were victims themselves, left homeless and separated from family and friends. The department lost more than 550 cruisers and at least three station houses; the city's computerized emergency 911 call system was destroyed.

In an emotional worship service Sunday, one police chaplain reflected on the bitter feelings toward colleagues who fled -- and the lesson that came three weeks later.

"They were not wings of doves. Some of them took Delta and American and Southwest and United," said Gervais Allison, a pastor who lost one of his two churches in the storm.

They fled to Baton Rouge, Lafayette, Lake Charles and Houston, he said, "not realizing Katrina's little sister Rita was coming. I've discovered the same trouble over here can be found over there."

Research editor Lucy Shackelford contributed to this report.

New Orleans Police Superintendent Eddie Compass is to quit within 45 days.