Rep. Joe Sestak, riding a wave of discontent with Washington, defeated incumbent Sen. Arlen Specter in the Democratic primary Tuesday, ending the career of the longest serving senator in Pennsylvania history.

Specter, 80, left the Republican Party last year in hopes of surviving, but lost his bid for a sixth term despite the backing of the Democratic establishment, from President Obama to Gov. Rendell and most of organized labor.

"It's been a great privilege to serve the people of Pennsylvania," Specter said, his eyes moist, as he appeared before 200 emotional supporters at the Sheraton Philadelphia City Center Hotel. "I'll work very hard for the people of the commonwealth in the coming months."

In his victory speech at the Valley Forge Military Academy and College, an exuberant Sestak, with his wife Susan and daughter Alex at his side, said the people had made their voices heard in a call for an end to politics as usual.

"This is what democracy looks like: a win for the people over the establishment, over the status quo," even over Washington, D.C," Sestak said.

Graciously, he called Specter, a cancer survivor, "someone who is truly courageous," drawing a round of applause from the crowd. "He has devoted his entire life to public service," he said, "and he and his lovely wife Joan deserve our thanks for that."

Despite the conciliatory tone, Sestak also bragged that his victory meant Pennsylvania would see a Senate campaign between "two very different philosophies" and drew a round of boos when he mentioned former President George W. Bush, whom he had labored to connect with Specter on the campaign trail.

Sestak will face Republican Pat Toomey, a former congressman from Allentown with strong backing from both the GOP establishment and conservative tea party activists. Toomey handily defeated conservative activist Peg Luksik.

In his remarks, Specter pledged to support Sestak. "It is vital that we keep this seat in the Democratic Party hands," he said.

Sestak's victory was sweeping. He carried every county but Philadelphia, Dauphin and Lackawanna. And although Specter won Philadelphia handily, turnout on a dismal rainy day was not high enough to save him.

With 98 percent of the state's precincts reporting, Sestak received about 54 percent of the vote to 46 percent for Specter, according to unofficial returns.

Specteris the third veteran member of Congress to go down in less than two weeks. Sen. Bob Bennett (R., Utah) and Rep. Alan Mollohan (D., W.Va.) were denied their parties' nominations.

Specter's case was different from the others', however.

After 28 years on the Republican side of the aisle in the Senate, he switched parties last year, with the encouragement and support of the White House. So as much as anything else, his campaign for reelection turned on whether Democratic voters trusted his conversion.

It also was a test of whether Obama, and the White House political operation, could deliver a victory to an ally.

"Anytime the economy is bad and people have lost hteir homes, lost their 401(k)s, they take it out on incumbents, whether that's fair or unfair," Rendell said.

For all of its knife-edge drama at the close, the Specter-Sestak matchup was sleepy until the final three weeks. Specter had a wide lead and Sestak remained unknown outside his congressional district in the Philadelphia suburbs.

Then Sestak began advertising on television and started to creep up in the polls.

The race became too close to call after a 30-second attack spot that showed Specter with three conservative icons: former President George W. Bush, former Sen. Rick Santorum (R., Pa.), and former GOP vice presidential candidate Sarah Palin. Footage followed of Specter saying, "My change in party will enable me to be reelected." The tagline: Specter switched to "save one job - his, not yours."

Specter's vote for Obama's $787 billion economic-stimulus plan destroyed his standing in the Republican Party. His approval rating dropping by half within a month, and he concluded he could not beat Toomey in a GOP primary. He said so, bluntly.

But Specter also said that the Republican Party had strayed too far to the right for moderates like him, and said he wanted to continue to deliver for the state.

In the final days of the race, Specter reframed the switch in light of the billions he has delivered for Pennsylvania, and the possibility of more - an old-fashioned appeal to voter self-interest in an anti-incumbent climate.

Sestak made Specter's switch the central issue of his challenge, saying he was a political opportunist who could not be trusted.

Sestak, 58, would not sit down when party leaders asked him to defer to the veteran Specter. Sestak, serving a second term in the U.S. House, is a retired rear admiral who served for 31 years in the Navy, including a stint on the Clinton White House staff and command of a carrier battle group off Afghanistan in 2001.

Obama was omnipresent for Specter in television and radio advertisements, telephone robo-calls, literature, and election-day "door hangers."

But when the polls tightened, Obama and Vice President Biden stayed away from Pennsylvania, despite pleas from state Democrats and the Specter campaign. White House aides said they wanted to avoid risking the president's political capital in another losing effort.

Indeed, on Tuesday, Obama visited Youngstown, Ohio, 22 miles from the Pennsylvania line, to talk about the economy. Air Force One passed 22,000 feet over Pittsburgh at 460 miles per hour to carry the president to his stop.

After all, Obama has had a miserable track record of personal campaigning for Democrats. Gubernatorial candidates for whom he campaigned lost in New Jersey and Virginia last fall, and a last-minute visit to Boston could not help Democrat Martha Coakley hold the late Sen. Edward M. Kennedy's seat for the party in a January special election.

A cold rain fell across Pennsylvania Tuesday, testing Specter's voter-turnout operation, which was staffed by union supporters and party organizations.

Sestak, who polls suggested had more fired-up backers, relied on volunteers but spent the bulk of his cash, a little more than $4 million on TV and radio.

Until now, Specter had made a habit of winning close races in which his political obituary was pre-written. He beat Democrat Lynn Yeakel in 1992, the "Year of the Woman," by 3 percentage points. In 2004, Specter beat Toomey, 51 percent to 49 percent, in the GOP primary.

Voters in the Philadelphia region were torn between the clout that Specter's seniority promised and a sense that it was time for a change.

About 3:30 p.m., Gloria McDowell Savage stepped into Wanda's Simply 2000 Hair Salon on 60th Street near Walnut Street to cast her vote for Specter. She said he had helped her brother fix a tax problem several years ago.

"You don't forget a bridge that carries you across," she said of Specter.

Dave Bell voted for Sestak at Grace Epiphany Episcopal Church in East Mount Airy, turned off by what he saw as Specter's conversion of convenience.

"Sestak's consistently progressive," said Bell, 68, a retired biomedical engineer.

At the polling station inside the Mummers Museum at Second Street and Washington Avenue in South Philadelphia, Peter Krasowski, a retired cook from the Army Reserve, also voted for Sestak.

"There should be a cutoff point," Krasowski said, referring to Specter's age. "I'm 63 and retired. Why do you have to work until you're 90?"

Contact staff writer Thomas Fitzgerald at 215-854-2718 or tfitzgerald@phillynews.com.

Inquirer staff writers Miriam Hill and John P. Martin contributed to this article.