HARRISBURG, Pa. (AP) — Democratic U.S. Sen. Bob Casey of Pennsylvania withstood a spending spree by coal-industry millionaire Republican Tom Smith to win a second term Tuesday in a race in which the political scion had been heavily favored.

Casey’s victory also cements a seat that Democrats had counted on in the struggle for control of the U.S. Senate.

READ MORE: Pennsylvania Health Officials Seeing Increase In Tick-Borne Diseases

Casey, 52, of Scranton, an ally of organized labor, had been a heavy, early favorite and was way ahead in polls through August. But Smith, a tea party favorite who made a fortune in western Pennsylvania’s coal-mining industry, invested more than $16 million of his own money in the race, hammering Casey for three months on TV and radio and forcing Casey to mount a strong response in the final weeks.

The race became increasingly negative in the final weeks, fought largely in TV ads.

Speaking to a boisterous crowd at a Scranton hotel, Casey thanked his supporters and said he had received a “very gracious” call from Smith to concede. He then said he would return to Washington, D.C., to help middle-class families and to work to bridge partisan divides on economic issues, taxes and spending.

“We’ve got a lot of work to do, but I have no doubt and I have total confidence in our ability to do that in both parties,” Casey said. “But it begins tonight in the aftermath of a tough election. I’m grateful for the vote of confidence the people of Pennsylvania have given me.”

In his concession speech at a downtown Pittsburgh hotel to a subdued crowd, Smith thanked Casey and called for Republicans and Democrats to work together.

“We both share a love for this country, and this state,” Smith said of Casey.

With 82 percent of precincts reporting, Casey had 2,213,523 votes, or 55 percent, to Smith’s 1,709,786 votes, or 43 percent. Libertarian Rayburn Smith took nearly 2 percent.

Although Casey had strong name recognition because he is the son of the late former Gov. Robert P. Casey, many voters were still learning the identities of the candidates in the final days before the election as the men campaigned in the shadow of the presidential race.

READ MORE: 36-Year-Old George Smith, Of New Jersey, Charged In 'Gas N Go' Fuel Spill In Delaware County

Counting spending by outside groups, Smith was on course to outspend Casey, $18 million to less than $9 million after July 1.

Casey first won the office in 2006 after soundly beating arch-conservative Sen. Rick Santorum. Based on preliminary results of an exit poll, independent voters split their votes about evenly between Casey and Smith, representing a huge drop in support for Casey compared with 2006.

The former state treasurer and auditor general ran as a moderate who put the interests of this diverse state ahead of party leaders. Casey had supported President Barack Obama’s signature policies, including his sweeping health care law, economic stimulus bill and overhaul of financial-sector regulations.

He also supported bailouts of banks and the American automakers, borrowing authorizations to avert a national default, tougher pollution standards on coal-fired power plants, higher income taxes on higher earners and an increase in the minimum wage.

Casey had attacked Smith as too extreme for Pennsylvania, and won nearly every endorsement from the state’s newspaper editorial pages.

Smith hewed closely to Republican Party-line positions, but had signaled that on key fiscal issues he would lean to the conservative side of party leaders in Congress, as well as GOP presidential nominee Mitt Romney.

Smith attacked Casey as a do-nothing career politician, the right hand of Obama and an overreaching and overspending government that is stifling entrepreneurship and the development of fossil fuels such as coal.

The campaign was Smith’s first statewide after many years of giving heavily to Republican causes while running his coal-mining business.

He started his own tea party group in 2009, sold his coal-mining businesses in 2010 and, after spending his life as one of western Pennsylvania’s many conservative Reagan Democrats, he switched his registration in 2011 to Republican. He won the party’s nomination by spending more than $5 million of his own money to win a five-way race that included a candidate endorsed by the state party and Gov. Tom Corbett.

MORE NEWS: 'End Of Watch Ride To Remember': Motorcycle Ride Honoring Fallen Officers Makes Stop In Philadelphia

(© Copyright 2012 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)