— Less than 72 hours after a defiant Texas Gov. Rick Perry (R) was booked by authorities in Austin on felony charges — then promptly went out for a well-documented frozen treat — he was greeted warmly by a small crowd of business leaders here Friday who mostly shrugged off his legal woes.

“I’ll have an ice cream cone with you at any time,” John Lyons, a local attorney who visited Perry in Texas this spring, told the governor as onlookers erupted in laughter.

This is Perry’s unexpected political geography these days: Back home, he’s embroiled in a serious legal battle. Beyond Texas, conservative activists and lawmakers are rallying to his side, calling him the victim of a politically motivated attack.

And here in New Hampshire — where a chilly reception in January 2012 drove him from the presidential race — he’s getting a much warmer greeting this time around.

“Hi, y’all,” a cheerful Perry told the crowd of about four dozen business leaders, along with a full roster of local and national media, all assembled in this seaside town to catch a glimpse of his first visit to the state since losing its Republican presidential primary vote 2 1 / 2 years ago.

The governor was in a chatty, retail-politicking mood. But he didn’t steer clear of less-pleasant topics.

“Some of you may have heard there are a few officials in Travis County, Texas, that would like to restrict my constitutional authority to veto a piece of legislation,” he told the Portsmouth Business Leaders Luncheon.

Perry pleaded not guilty Tuesday to felony charges that he abused his powers and tried to coerce a public official to resign.

He threatened to veto funding for an anti-corruption agency that is part of the Travis County district attorney’s office if Travis County District Attorney Rosemary Lehmberg (D) didn’t step down following her 2013 drunken-driving arrest.

She refused. He made good on his threat. A watchdog group filed an ethics complaint, and a grand jury indicted Perry last week.

But he has since received an outpouring of support from prominent conservatives such as former Florida governor Jeb Bush and New Jersey Gov. Chris Christie, both potential 2016 rivals. And he had plenty of sympathizers in New Hampshire.

“He was very much within his legal rights to defund the program,” said Connie Phelps, 71, of Stratham.

Dennis Riendeau, 58, of Portsmouth, was skeptical of the charges.

“I just question the timing of it,” he said.

Capitalizing on some of that conservative skepticism, Perry’s political action committee has been selling T-shirts that claim the governor is “Wanted” for “securing the border and defeating Democrats” and that Lehmberg is “Guilty” of “driving while intoxicated and perversion of justice.”

Perry, sharply dressed in a sky blue shirt and pastel pink tie under a dark suit, gestured emphatically with his hands as he endorsed the idea that he is a political target. He described Travis County — which includes the liberal hotbed of Austin — as “the blueberry in the tomato soup” of ruby-red Texas.

With his appearance here, Perry kicked off a two-day swing through the state, with plans to attend six public events in two days, including a Saturday rally for the New Hampshire Republican Party. He’ll also mingle with conservative activists at a pork roast and a picnic.

Perry dropped out of the 2012 presidential contest after getting less than 1 percent of the GOP primary vote in New Hampshire. As he weighs another bid, he’s trying to engage more with the state than he did last time.

“I didn’t stay here long enough. I didn’t spend the time. I didn’t put in the preparatory time,” he said Friday.

Perry sounded every inch the candidate Friday, calling for a robust effort to root out radical Islamic State militants in Iraq.

He doubled down on his claim that militant extremists may have entered the United States on its southern border.

He paid tribute to James Foley, the American photojournalist from New Hampshire who was executed by extremist Islamist forces.

And he said authorities in tumultuous Ferguson, Mo., need to find a way to balance safety with freedom.

“I want the people in Ferguson to have faith in their local government who is there to protect them, not to intimidate them,” he said.

Texas, and the legal headaches that await him back home, felt far away.

“It is what it is,” he said. “I’ve got a great legal team put together to defend me. And hopefully it will be behind us quickly.”