House Democrats chose California Rep. Nancy Pelosi as their new minority whip yesterday, making her the highest-ranking woman in congressional history while delivering a serious blow to one of Maryland's most prominent politicians.

Pelosi defeated 11-term Maryland Rep. Steny H. Hoyer by 118 to 95 votes in the secret balloting to replace Michigan Rep. David E. Bonior, who is retiring to run for governor in his home state.

"This is difficult turf to win on for anyone, but for a woman breaking ground here, it was a tough battle," Pelosi said after the election, which places her second in the House Democratic hierarchy after Minority Leader Richard A. Gephardt (D-Mo.). "We made history, and now we have to make progress," she added, vowing to help Democrats retake control of the House.

Pelosi, 61, is in her eighth term representing San Francisco and will assume the whip post in January. She said her win was "about the new; it's not about male or female."

But her selection as whip, whose job is to count votes and round up support for the party's agenda, represented a new prominence for women in a profession that has long been almost all-male and that even now has only a few women in its uppermost echelons.

GOP Rep. Jennifer Dunn (Wash.) ran unsuccessfully for majority leader in 1998, and no woman had risen above the fourth-ranked post in the House. On the Senate side, Maryland's Barbara A. Mikulski's position as conference secretary places the Democrat third on the leadership ladder.

Kim A. Gandy, president of the National Organization for Women, said the win "shattered a long-standing congressional glass ceiling." Sen. Hillary Rodham Clinton (D-N.Y.) said it "sends a real message to the country about the party's commitment to women in the political process."

At the same time, the vote represented a political setback for Hoyer, who lost a previous bid for whip a decade ago. Hoyer was once a fast-rising star in Maryland politics -- he won the post of state senate president at 35 -- but Democrats said privately it would be difficult for him to seek higher office in the future.

Hoyer declined interview requests, but aides said he told them after the vote, "Gender and geography were against us, and they won out." That was a reference to Pelosi's home state of California, which has 32 Democrats in its delegation, compared with four from Maryland.

"I naturally regret having failed to get a majority of the caucus to support my candidacy for whip," Hoyer said in a statement. Pelosi, he said, "has been my friend for almost 40 years, and I am confident that she will do an outstanding job as our whip."

Hoyer allies said he would continue in his leadership positions as co-chairman of the Democratic Steering Committee and chief candidate recruiter for the Democratic Congressional Campaign Committee, and could possibly run again.

"He's lived the ups and downs of politics; he knows there's always another day," Rep. Albert R. Wynn (D-Md.) said.

The rivalry between Hoyer and Pelosi centered on which candidate could best help the party return to power. Hoyer campaigned as a moderate who could help the party win in swing districts, while Pelosi argued her election and emphasis on rank-and-file members would convey a message of diversity to voters.

The two candidates were similar in many ways, with relatively liberal voting records and seats on the influential House Appropriations Committee. They also gave generously to their colleagues last election as they pursued their leadership bid: Pelosi provided $1.1 million in donations, while Hoyer gave $927,000, putting them in the top five of congressional contributors, according to the Center for Responsive Politics.

But although Hoyer had chaired the Democratic Caucus and served in other leadership posts, Pelosi styled herself as an outsider who would bring a fresh approach to inside-the-Beltway politics.

"The party honestly needs to be energized," said Massachusetts Rep. William D. Delahunt. "There's an excitement about Nancy."

"She's going to bring in fresh voices," said Rep. Mike Thompson (D-Calif.). But a conservative Democrat who asked not to be identified expressed concern that Pelosi sent the wrong message to swing voters. "My concern is that perception is bigger than reality," the lawmaker said. "A woman from California who is a liberal, from my point of view, casts the wrong image for where the party wants to be. We want to be in the center."

But leadership contests are intensely personal and often reflect a member's individual lobbying skills rather than broad ideological positions. First-term Minnesota Rep. Betty McCollum, for example, recalled that while Hoyer supported her candidacy once she had won the party primary last year, Pelosi had offered advice and counsel even earlier.

"Nancy had called first," said McCollum, who spoke on Pelosi's behalf yesterday.

Pelosi, who declared victory as early as last summer and pushed her backers to make their support public, said in recent weeks she would garner about 120 votes. Hoyer announced he had 105 votes as late as Tuesday, meaning that at least 10 of his colleagues privately threw their support to Pelosi.

Both camps launched elaborate get-out-the-vote efforts since attendance can be a deciding factor in close elections. Pelosi's aides made 7:30 a.m. wake-up calls to each of the supporters and offered rides to lawmakers such as Rep. Tom Udall (N.M.), who lives just a few blocks from the Capitol.

In the end, yesterday's turnout surpassed expectations. Nearly every Democrat voted -- one lawmaker cast a blank ballot -- with Michigan Rep. John Conyers Jr. rushing in at the last minute to cast a vote in favor of Pelosi.

Staff writer Spencer Hsu contributed to this report.

The Democrats' new House minority whip, Rep. Nancy Pelosi, brandishes a whip as she embraces outgoing Whip Rep. David E. Bonior yesterday.Democrats' new House Minority whip, Rep. Nancy Pelosi of California, is congratulated by Maryland Rep. Steny H. Hoyer after the vote yesterday. It was a political setback for Hoyer.