Ohio Gov. John Kasich answers a question during an interview on his campaign bus in Bow, N.H., on Wednesday. (Charles Krupa/AP)

It was a very good week for John Kasich in New Hampshire.

Largely forgotten in the nationwide presidential race, the Ohio governor almost got kicked off the main stage at the most recent GOP debate. But a series of recent polls now rank Kasich second or third behind Republican front-runner Donald Trump in the Granite State, a feat he achieved after months of methodical campaigning here.

The sudden uptick drew the attention of a multimillion-dollar super PAC supporting Jeb Bush’s presidential campaign, which unloaded a new attack ad on Thursday that faults Kasich for expanding Medicaid in Ohio and for voting as a congressman to cut military spending that forced the closure of a New Hampshire military base.

In response, a super PAC backing Kasich produced an ad that literally slings mud onto a likeness of Bush and calls the former Florida governor unpresidential. The Kasich campaign also released a Web video Friday mocking Bush’s record as Florida governor, claiming he raised fees on doctors’ visits for poor children, increased college tuition and hiked the cost of owning a pet snake.

Amid the sniping, though, Kasich has mostly been striving to keep it clean and nonpartisan in a state that demands intimate retail campaigning — and where voters like to hear lines such as the ones he delivered this week.

People wait outside the campaign bus of Ohio Gov. John Kasich during a stop at Bektash Shriners Wednesday in Concord, N.H. Polls have Kasich in second place behind Donald Trump in the state. (Darren Mccollester/Getty Images)

“I happen to be a Republican, but so what?” he said during an appearance at a logistics company here in Bow. “The Republican Party is my vehicle, not my master.”

Earlier, at a town hall in Concord, N.H., he told a crowd of about 80 people: “We don’t get energy by being negative. I am so tired of my colleagues out here on the stage spending all their time talking about Barack Obama. His term is over!”

That message stands in stark contrast with his GOP establishment-friendly rivals — Bush, New Jersey Gov. Chris Christie and Sen. Marco Rubio (Fla.) — all of whom are statistically tied with Kasich in recent surveys here but deliver a more partisan message overall on the trail. Taking note of that contrast, four New Hampshire newspapers bucked the ­better-known candidates and endorsed Kasich this week.

As he builds support here, Kasich (pronounced “kay-sick,” but voters here often say “kay-sitch”) is airing a television ad that resembles a sales pitch for pickup trucks or beer— a biographical message that tells Americans to “never give up” and stands out on airwaves flooded with attack ads. His team claims that they’ve had more direct contact with voters than anyone else — a statement that almost every campaign makes at some point. But the governor has hosted more than 60 town-hall-style events across the state, which is more than his opponents.

[John Kasich has a novel pitch to voters: He’s a politician]

At the logistics company in Bow, he hung out with mostly working-class, middle-aged employees, making fun of their ­bosses and fielding questions about veterans and corporate taxes. Dressed in a blue pullover sweater, white button-down shirt and gray slacks, the governor detailed a rundown of his biography, including winning a seat in Congress, two terms as Ohio governor and hosting a Fox News talk show.

“And you know what? I ain’t that good,” he said. “You know what happened? The Lord has put His hand on me for some reason. He’s got His hand on everybody in this room, if you let them. And everybody in this room was made special. . . . This isn’t a political speech — it’s a life talk.”

Ohio Gov. John Kasich speaks during a campaign stop at Bektash Shriners Wednesday in Concord, N.H. (Darren Mccollester/Getty Images)

Kasich “reminds me a little bit of Ronald Reagan,” said Bill Meisel, 50, who sat in the front row listening to the governor. “He’s focused on changing Americans’ feelings of America.” For now, Meisel said Kasich is “one of two” candidates he’s considering. The other is Bush, whom he hasn’t seen yet.

Fergus Cullen, a former state GOP chairman who attended more than 20 public events hosted by candidates before making an endorsement, gave his support to Kasich on Thursday.

“I’m sensitive to the fact that he’s from a swing state,” Cullen said. “We’ve got a bunch of candidates who are only talking to base Republican voters and are used to in their careers only talking to base Republican voters. That’s not Kasich’s background.”

Ultimately, Kasich will need to rely on a mix of establishment Republicans such as Cullen and independent voters who can vote in New Hampshire party primaries. Roughly 44 percent of the New Hampshire electorate, independents are increasingly being wooed by Kasich, Trump and Democratic presidential candidate Bernie Sanders, the senator from neighboring Vermont.

A New Hampshire poll released Thursday by Boston radio station WBUR found that Kasich is the Republican presidential candidate that independent voters prefer. And he’s the only candidate besides Sanders that independents view favorably overall. The survey also found that Kasich is statistically tied with Trump among independents, 19 percent to 20 percent.

Former Republican senator John Sununu, who served with Kasich in the House in the 1990s, said that the governor’s pitch should seem familiar to many New Hampshire voters.

“His presence and approach to town hall meetings is probably a bit more like that of John McCain,” he said. “His chief executive experience and the confidence that inspires is probably a little bit more like a Mitt Romney. His optimistic vision is probably a little bit more like Ronald Reagan.”

McCain, Romney and Reagan all won the New Hampshire Republican primary.

How Kasich could capi­tal­ize on a win in New Hampshire is less certain, and he is still polling in the low single digits in Iowa, South Carolina and national surveys of Republicans. Unlike Trump, Rubio, Bush and Sen. Ted Cruz (Tex.), who have hefty operations already running in states with later contests, Kasich has little presence anywhere else.

That’s where friends like Trent Lott come into play. The former Senate majority leader has reactivated his political operation in Mississippi to help Kasich prepare for the Magnolia State’s GOP primary on March 8. Kasich’s team hopes to do well in New Hampshire and survive until the winner-take-all primary in Ohio on March 15. At the least, they figure that winning his home state’s 66 Republican delegates could make him a kingmaker at a brokered convention.

Then there’s the Kasich super PAC, New Day America, which has spent roughly $5.53 million to date and has been reaching out to New Hampshire voters since October, according to a spokeswoman. The PAC has six offices across New Hampshire and employs 17 full-time staffers in the state. That’s far fewer than Bush’s team but more than other rivals.

In Concord, Kasich marveled at all the media attention and how his campaign has “risen from obscurity now to second place.”

“If I win, great,” he said. “If I don’t win, I got another crusade somewhere else.”

Scott Clement and Anu Narayanswamy in Washington contributed to this report.