Of course, Toomey benefited from the wave against the policies of President Obama and the Democratic Congress. A conservative former congressman from the Lehigh Valley, Toomey campaigned hard against deficit spending and the burgeoning federal debt, and called for extending the 2003 tax cuts to spur the economy.
Those who said they were "very worried" about the economy - a little more than half the Pennsylvania electorate Tuesday - gave 69 percent of their votes to Toomey, according to media exit polls.
A look at those polls, along with patterns in state returns and interviews with analysts and officials in both campaigns, showed that Toomey also won because a lot of seemingly small things went right for him.
"We really had historic Republican turnout numbers in the rest of the state," Toomey campaign manager Mark D. Harris said Wednesday.
Toomey split Philadelphia's four suburban counties with Sestak, a second-term congressman from Delaware County, a better performance than recent statewide GOP candidates managed. He won higher vote margins in Republican strongholds than usual for a midterm election, and he carried several Western Pennsylvania counties, including Beaver, Washington, and Fayette, dominated by conservative Democrats.
For instance, Toomey reaped a 54,000-vote margin in Lancaster County, after planning for a robust but more normal 40,000. The Republican also outperformed projections in Lycoming and Mifflin Counties..
Toomey carried Chester County by 8 percentage points and Bucks by 7 percentage points, while Sestak carried Delaware 56 percent to 44 percent and Montgomery 54 percent to 46 percent.
Toomey carried independents by 55 percent to 44 percent. They had been crucial to Democratic victories in 2006 and 2008.