Frank Rizzo, who worked his way up from beat cop to mayor in the 1970s, claimed the Republican nomination for his old job while Democrats picked a former district attorney to pull Philadelphia back from the brink of financial collapse.

Rizzo, 70, will face Ed Rendell Nov. 5 if he can withstand a recount likely to be requested by another former district attorney, Ron Castille. Rizzo had a 1,120-vote lead over Castille with 99 percent of the precincts counted.Also Tuesday, Denver voters ensured that the city will get its first black mayor. District Attorney Norm Early won but fell short of a majority in a primary to succeed Mayor Federico Pena, who did not seek a third term.

Early will meet the second-place finisher, City Auditor Wellington Webb, in a June 18 runoff. Early and Webb are black.

Denver voters also defeated an attempt to repeal an ordinance banning discrimination against homosexuals.

In Philadelphia, Rizzo claimed victory in his third comeback attempt, but Castille refused to concede defeat.

"We'll wait for the official count," Castille said. It could take a week for an official tally. The loser then could seek a recount.

On the GOP side, Rizzo had an unofficial 46,786 votes, or 36 percent, while Castille had 45,666 votes, or 35 percent. Political unknown Samuel Katz had 36,902 votes, or 29 percent.

In the four-way Democratic primary, Rendell had 143,479 votes, or 49 percent. Former City Councilman Lucien Blackwell was second with 78,807 votes.

Rizzo, a burly, tough-talking, tell-it-to-the-judge police commissioner who served two terms in City Hall as a Democrat, switched to the GOP after his first comeback attempt. He lost his last two bids to Democratic Mayor W. Wilson Goode.

"Tonight, we made history," Rizzo said. "Our victory is not just for those who gathered here tonight. It's not just for those who voted for Frank Rizzo. It's a victory for every family in Philadelphia."

Philadelphia's next mayor is likely to have to answer to a financial oversight board as the price of a bailout under consideration by the state.