Pennsylvania stretches about 400 miles, but the tale of Democrats' U.S. Senate primary was told in two cities.

Backed by the party's biggest names and money, Katie McGinty on Tuesday scored a huge win in Philadelphia. Unofficial results show she topped her chief rival, Joe Sestak, by 46,500 votes in the city - nearly a third of her overall victory margin.

On the other side of the state, the hulking mayor of Braddock, John Fetterman, who created buzz with his antiestablishment style, racked up a surprise win in his home county of Allegheny, and drew more than twice as many votes statewide as polls suggested he would.

The routs in two Democratic strongholds left Sestak, a former congressman and admiral, and the onetime front-runner in the race, with a narrow path to victory that he couldn't navigate.

As a Democrat, "you really have very few places to go for votes" if you lose in Philadelphia and Pittsburgh, said Joe Corrigan, a Democratic consultant from the Philadelphia area.

He said Sestak needed massive margins in the Philadelphia suburbs and other key counties to overcome the damage, but didn't get them.

What was expected to be a tight race turned into a 10-point McGinty victory.

Now McGinty will challenge Sen. Pat Toomey (R., Pa.) in a race that could determine control of the Senate.

Sestak's political career may suddenly be over. He was unavailable to comment Wednesday, according to his campaign.

But one Sestak ally said the campaign had predicted that it could not win if Fetterman got more than 15 percent of the vote. He got 20.

Operatives on all sides surmised that much of Fetterman's support came from the same base of voters who might have picked Sestak: liberals rejecting insider politics.

"I don't think you can assume that every one of those votes goes to Joe," said David Dunphy, a Democratic consultant. "It would have been substantially closer, though."

Fetterman disputed the idea that he was a spoiler, and chalked up his big showing to a populist message that resonated. He said Sestak had plenty of time and money to secure support.

In his 2010 victory for the Senate nomination, won in the face of opposition from the party establishment, Sestak relied on grassroots ties, including support from black churches, to drive turnout in Philadelphia.

But McGinty's endorsement from President Obama - heavily promoted in her ads - showed the power big names can have, putting her on the same side as a president who won 85 percent of the city's vote in 2012.

And her edge was likely exacerbated by hotly contested races that had multiple campaigns pulling Philadelphia voters to the polls and spiking turnout, including the Second Congressional District contest featuring U.S. Rep. Chaka Fattah and State Rep. Dwight Evans.

That district, with 5.5 percent of Pennsylvania's population, produced more than 11 percent of the votes in the Senate race, according to one operative.

None of this overshadows the impact of money and television. With more than $4.5 million in aid from party backers in Washington, McGinty outspent Sestak and his supporters on television advertising, $6.1 million to $3.7 million, according to the same person, a Sestak ally tracking the buys.

At one point, an average person in key media markets would have seen a McGinty ad - or attack on Sestak - roughly 30 times a week, Corrigan said, citing public information about ad buys.

"When a campaign is up on TV as much as Katie McGinty's campaign was, it's very difficult to counteract," he said.

McGinty attributed her win to a message that resonated and a broad coalition of support.

Her challenge now, with a depleted campaign fund, is to spread her story - mother of three and working-class advocate who rose from blue-collar roots - before Republicans can make their version stick: liberal bureaucrat who used the revolving door to flip from government to high-paying corporate jobs.

Just hours after the primary wrapped up, she and the incumbent traded volleys.

"We're going to have a very robust discussion about the things that Katie McGinty has done," Toomey said in an interview Wednesday morning.

Toomey said he would promote his record of fighting policies that stunt the economy and promoting public safety, such as standing up for law enforcement.

McGinty said Toomey's attacks are an attempt to deflect attention from a record that favors Wall Street over average Pennsylvanians. "If you want somebody who is a champion for the middle class, someone who is going to fight every day for hardworking families, that's what I intend to do," she said at a stop at Murray's Deli in Bala Cynwyd.

Their contrast will be far more stark than the one McGinty had with her fellow Democrats, but she won't have the money edge that powered her in the primary. Toomey's campaign fund has more than $9 million to make his case, according to its last filings.

McGinty's hope might depend on voters like Marcia Connelly, whom she met at the diner.

Connelly recognized the candidate from her ads with Obama. "She just really seemed like she was very capable," Connelly said.

An independent, Connelly said she didn't vote in the Democratic primary, but planned to support McGinty, Gov. Wolf's former chief of staff, in November.

But another customer, Roberta Hirsch, said the national party "made a major mistake" by pushing McGinty over Sestak.

"I'll vote for her because I don't like Toomey," Hirsch said, "but my gut feeling is, she won't beat Toomey."

McGinty downplayed any rift.

"The issues and the values are always much more important than the candidate," she said, "and we're standing for values that are very much at stake."

jtamari@phillynews.com@JonathanTamari