After months of behind-the-scenes maneuvering, the powerful head of the city electricians union, John Dougherty, became Democratic leader of South Philadelphia's 1st Ward last night, winning a unanimous vote after potential opponents dropped out.

Dougherty lives just outside the ward boundaries and was not allowed inside the meeting at a Tasker Street restaurant where the ward's recently elected committeemen were deciding.

But he showed up immediately afterward to lead a birthday party in honor of the retiring ward leader, Joe Hoffman Sr., who turned 89 on Memorial Day. Dougherty had six buttercream cakes from the Melrose Diner waiting for Hoffman.

Hoffman insisted as recently as Sunday that he was still running. But without sufficient votes, he dropped out in favor of Dougherty, a major fundraiser who was city Democratic treasurer until a falling out with party chairman Bob Brady four years ago.

Dougherty said he planned to open a modern ward headquarters with wi-fi Internet service, a Web page and a Facebook account. He moved to have Hoffman named "ward leader emeritus."

"As I've said before, we'll have two feet in the future and one in the past," Dougherty said.

Next door, in South Philadelphia's 2nd Ward, the Democratic committeemen were split down the middle between incumbent ward leader Ed Nesmith and Nick Schmanek, an aide to City Councilman Frank DiCicco.

Nesmith, who had lost his committeeman's seat in last month's primary, presided and eventually cast what he said was the deciding vote to re-elect himself, 28-27. Schmanek said the result would be appealed to a contest panel of Democratic City Committee.

The city's Republican organization also elected new ward leaders last night, and there were no surprises in Northeast Philadelphia, the city's strongest Republican area, where ward leaders loyal to the party's general counsel, Michael P. Meehan, generally won re-election without opposition.

The one exception was the 65th Ward, where ward leader Phillip Innamorato, a Meehan critic, faced a significant challenge but prevailed over Thomas Matkow-ski, 14-13.

In other parts of the city with sparse numbers of GOP voters, Republican ward organizations elected leaders who've been strong Meehan critics, allied with an effort funded by Republican State Committee to reorganize the local party.

Al Schmidt, in charge of the State Committee's local effort, was elected Republican ward leader in East Falls, the 38th Ward, and Joseph DeFelice, another State Committee organizer, was elected GOP ward leader in Overbrook's 34th Ward, Brady's home turf.

Kevin Kelly, founder of a Republican insurgent group called the Loyal Opposition, was elected ward leader in West Mount Airy, the 22nd Ward. In Center City's 8th Ward, newcomer Lindsay Doering defeated Suzanne Cohen, a longtime Meehan loyalist.

Two incumbent ward leaders who've been feuding openly with Meehan, Matt Wolfe in University City and Michael Cibik in Center City, won re-election easily.