Follow CBSPHILLY Facebook  | Twitter

PHILADELPHIA (CBS/AP) — Tom Wolf has won a second term as governor of Pennsylvania as he defeated Republican candidate Scott Wagner in what was a very contentious race, according to The Associated Press.

The governor was pacing more than two dozen points ahead of Wagner heading into the election.

Philadelphia Voters Report Broken Machines, Unable To Vote For Correct Candidates

Wolf has said he will continue advancing his first-term priorities, including trying to fix funding inequities in public schools and seeking to impose a severance tax on the Marcellus Shale natural gas industry. But he will be up against Republican lawmakers who fought two extended budget battles with him, blocked many of his top priorities and forced him to lower his expectations.

Even so, Wolf’s re-election will give Democrats a seat at the table for the first time in 30 years when Pennsylvania draws a new map of congressional districts after the 2020 Census.

ef3b33efcee54b0e8392ba42ec64c84a Pennsylvania Gov. Tom Wolf Wins Second Term In Contentious Race Against Republican Scott Wagner

Credit: CBS3

Wolf, speaking to supporters in York on Tuesday night, said Pennsylvanians voted for a state “that has a really bright future” and “for a public service that actually has integrity, that you can trust.”

In brief remarks, Wolf said people had voted for better lives, better schools, a strong economy, access to quality and affordable health care and a fairer Pennsylvania for everyone, regardless of race, gender or religion.

“I’m proud of what we’ve already done together,” Wolf said. “But four years ago I stood before you and said, ‘You know, we have a lot of work to do, so let’s get started.’ Tonight, I have basically the same message: We still have a lot of work to do. So let’s back to work, all right?”

FULL ELECTION RESULTS

Wagner, meanwhile, closed his campaign echoing Trump’s hard-edged message on illegal immigration, accusing Wolf of being soft on illegal immigrants and sanctuary cities and opposing sending troops to the border for the migrant caravan making its way north in Mexico. Wagner warns that Wolf will raise taxes while he is pledging to cut taxes, eliminate property taxes and rein in an out-of-control state government.

‘If He Can Do It At 101, We All Can Do It:’ North Philadelphia Centenarian Votes On Election Day

“Feeling good, I’m optimistic. I believe we are going to win this, well I know we’re going to win it,” Wagner said after voting.

Last month, Wagner said he would “stomp all over” Wolf’s face and “win this” during a nearly three-minute-long video posted on Facebook. Wagner’s campaign at the time said his comments were not meant to be taken literally and were a metaphor for how he would approach the campaign’s final stretch. The video was quickly taken down.

The two candidates were studies in contrast. Wolf is soft-spoken and chooses his words carefully. When Wagner announced his candidacy, he declared, “I am going to be the next governor, take that to the bank.”

Wagner said he called Wolf to congratulate him on the victory and brought up the issue of school property taxes.

“I did ask Gov. Wolf one thing,” Wagner said. “I said, ‘Gov. Wolf, I’m asking you to do something about the seniors who are losing their home to taxes.'”

Wagner, a 63-year-old former state senator who made millions from his garbage-hauling business, mostly self-financed his campaign. He had promised to cut taxes and rein in an out-of-control state government. But he fought an unexpectedly bruising and expensive three-way primary, and spent considerable time trying to walk back previous comments he had made, including criticisms public schools and teachers, while struggling to exploit a weakness in his opponent.

Meanwhile, Wolf heavily outraised and outspent Wagner, with help from labor unions that Wagner had made the target of some of his sharpest criticisms.

Election Fraud Task Force Tackles Issues At Polls In Philadelphia

Wolf, 69, ran his family’s building products company for most of three decades before becoming governor in 2015, except for a short stint as Pennsylvania’s revenue secretary.

He has been a champion for liberal causes, including imposing an effective moratorium on the death penalty, defending Pennsylvania’s expansion of Medicaid under the 2010 federal health care law known as “Obamacare” and blocking legislation that would have curtailed abortion rights.

Joining Wolf as lieutenant governor will be John Fetterman, the Braddock mayor whose efforts to improve the impoverished town over the past 13 years drew national attention and made him a media darling. Fetterman beat sitting Lt. Gov. Mike Stack in a five-way Democratic primary in May.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)