HARRISBURG, Pa. (AP) — For the second straight year following President Donald Trump's election, voters in Philadelphia's politically moderate suburbs flexed their muscles to help Democrats.

Bucks, Chester and Montgomery counties recorded the highest turnout rates in the state, according to an Associated Press analysis of preliminary results from Tuesday's election. Montgomery County led the way, with nearly 67 percent turnout, and party officials there credited a groundswell of activism in response to Trump.

"There was a lot of energy, and that energy started after November 2016 and grew and grew and grew, and there were a lot of motivated people canvassing for months and it just built up until November, and all that hard work paid off," said Rep. Tim Briggs, D-Montgomery.

Philadelphia's four suburban counties, including Delaware County, accounted for a larger share of the statewide vote than they usually do, exceeding 23 percent. In past statewide elections, that percentage has topped out at just above 22 percent.

Voters there flipped at least 12 state House seats and four state Senate seats from red to blue, the biggest single pickups by Democrats in decades. Democrats could expand their catch: five House and two Senate districts, all but one most recently in Republican hands, remained too close to call Thursday.

Suburban voters gave Democratic Gov. Tom Wolf a staggering 320,000-vote margin over Republican challenger Scott Wagner, the biggest margin since 2006 when then-Gov. Ed Rendell blew out Republican challenger Lynn Swann in the four counties by 374,000 votes.

Democratic Sen. Bob Casey also won by 283,000, beating Republican U.S. Rep. Lou Barletta on Tuesday.

Winning the suburbs has almost always been necessary to win the rest of Pennsylvania. But in 2016, Trump lost the suburbs by 188,000 votes to Democrat Hillary Clinton on his way to becoming the first Republican presidential candidate since 1988 to claim Pennsylvania's electoral votes.

Now, Trump's performance as president is helping drive strong turnout and stronger election performances for Democrats in the four heavily populated counties, officials from both political parties said Thursday.

In last year's municipal election, Democrats inflamed by Trump scored big victories in county and municipal races across Philadelphia's suburbs, advancing a decades-long shift in those one-time Republican bastions.

"It's going to be even more problematic for many of these folks two years from now that are running on the Republican ticket," said John Cordisco, Bucks County's Democratic Party chairman.

Democrats have long sought deeper inroads into suburban Philadelphia's bloc of eight state Senate seats. Currently, Democrats hold one. After January's swearing in of new senators, Democrats will hold a majority of those eight Senate seats.

Senate Minority Leader Jay Costa, D-Allegheny, credited good candidates, a couple open seats and an outpouring of voters.

In the House, Democrats now control a majority of the roughly 40 seats that sprawl across the four suburban counties.

Still, the news wasn't all bad for Republicans in the suburbs: U.S. Rep. Brian Fitzpatrick narrowly won a second term in his closely divided district in Bucks County.

Around the rest of the state, Republicans held on to their majorities in the state House and state Senate, and two other Republican congressmen from around the state narrowly survived stiff challenges. Turnout was relatively poor in several counties where it could have helped Democrats.

For instance, in the northwestern Pennsylvania congressional seat defended by four-term Republican Rep. Mike Kelly, turnout in heavily Democratic Erie County barely broke 50 percent. Meanwhile, turnout broke 55 percent in the four counties won by Kelly, helping him to a 4 percentage point win over Democrat Ron DiNicola.

In Lancaster County, one of the most populous Republican-majority counties, turnout broke 60 percent, as it did in several other less-populous Republican-majority counties. Republicans said Thursday that Trump is motivating their voters, as well as Democrats.

"I have found that much more of the voters are awakening to what's going on," said Pat Poprik, the GOP chairwoman in Bucks County. "We were trying to get more Republicans out in the election and we were successful, and so were the Democrats."

———

This story has been corrected to note Donald Trump was first Republican to win Pennsylvania since 1988, not simply the first.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.