Pennsylvania voters gave Democratic U.S. Sen. Bob Casey a second six-year term and elected Democrats to all three row offices up for grabs on Tuesday, while Barack Obama maintained the party's hold on a state that hasn't voted Republican for president in nearly a quarter century.

Casey—namesake son of the late governor, former state officeholder and reliable ally of organized labor—beat back a challenge from Smith, a conservative who poured millions of dollars of his own coal mining-industry fortune into the campaign, to help Democrats retain control of the U.S. Senate.

Obama, meanwhile, fended off a late incursion by GOP challenger Mitt Romney in a state that's long played a key role for Democrats seeking the White House.

Amid heavy turnout and some confusion over the state's suspended voter-identification law, Pennsylvanians also put Democrats in charge of three statewide row offices—attorney general, auditor general and treasurer—while keeping Republicans in control of the state Legislature and Pennsylvania's congressional delegation.

The presidential campaign had bypassed Pennsylvania—seemingly confirming its diminished status as a battleground—until a late blitz of TV ads and visits by Romney and his Republican allies. The Obama campaign responded in kind, defending a state crucial to the incumbent's re-election. No Democrat has won the White House without Pennsylvania in 64 years.

Democrats called Romney's play for Pennsylvania an act of desperation and were quick to distribute a list of earlier GOP contenders who'd made similar last-minute forays—only to see their hopes crushed on Election Day.

As Pennsylvania voters headed to the polls, their foremost concern was the state of the economy. Six in 10 called it their top issue, according to results from an exit poll conducted for The Associated Press and television networks. Only one in five voters said they're better off today than they were four years ago.

But many said weren't prepared to hand the White House keys to Romney.

Franco Montalto, 39, an environmental engineer voting for Obama in Philadelphia, said the frustration he felt over the slow pace of economic recovery was tempered by his distaste of "dangerous" Republicans.

Outside a volunteer fire station in rural Lamar in Clinton County, though, auto parts store employee Frank Frederick said he didn't like where the country was headed under Obama and gave Romney his vote.

"He's a take-charge guy. He impresses me because he can fix things," said Fredrick, 66.

In the mostly low-profile but aggressively fought Senate contest, Smith had portrayed his opponent as a do-nothing rubber stamp of Obama. Casey, in turn, cast Smith as a tea party darling whose positions were too extreme for Pennsylvania.

Candidates for Congress ran in 18 districts newly drawn by Republicans who control the Legislature. The GOP built on its majority in the U.S. House by taking the rejiggered 12th District in western Pennsylvania, where conservative Republican Keith Rothfus ousted Democratic U.S. Rep. Mark Critz. Few of the other congressional races were competitive this year.

The open seat for attorney general attracted the most attention of three statewide offices on the ballot as Kathleen Kane, a former prosecutor from Lackawanna County, became the first woman elected to the office—and the first Democrat—since its creation in 1980. She beat Republican David Freed, the Cumberland County District Attorney.

Democratic State Treasurer Rob McCord won re-election to a second four-year term, downing Republican Diana Irey Vaughan, a longtime Washington County commissioner.

In the race for auditor general, the state's independent fiscal watchdog, Democrat Eugene DePasquale of York County beat Republican John Maher of Allegheny County. Incumbent Jack Wagner is stepping down after serving the maximum two consecutive terms. 

Republicans were widely expected to hang on to their healthy majorities in both chambers of the Legislature.

Tuesday's election brought familiar claims of voting irregularities. Scattered problems were reported at polling places across Pennsylvania, including an electronic voting machine that switched a vote from Obama to Romney, concerns over a mural of Obama painted on the wall of a school being used as a polling location, and a court battle over dozens of Republican election workers improperly barred from polling places in Philadelphia.

And Philadelphia-based election watchdog group Committee of Seventy said some election workers demanded photo ID from voters, even though a judge had temporarily blocked a new state law requiring it to vote.

Superstorm Sandy, meanwhile, forced the relocation of a single Pennsylvania polling place, in the Philadelphia suburb of Riegelsville, Bucks County, according to phillyburbs.com.

———

Associated Press writers Patrick Walters in Philadelphia and Genaro C. Armas in Lamar contributed to this report.