Republican presidential candidate Sen. Ted Cruz (R-Texas) speaks during a campaign stop at the Republican Liberty Caucus in Nashua, N.H., on Oct. 9, 2015. (Jim Cole/AP)

Sen. Ted Cruz (R-Tex.) came to a convention of libertarian-leaning Republicans and talked about shrinking government, slashing regulations, fighting against the bulk collection of phone data and his great affinity for a rival in the presidential race.

“I love Rand Paul,” Cruz said.

Paul, Kentucky’s junior U.S. senator and scion of one of the country’s most famous libertarian families, was expected to lock down the support of libertarian voters in the presidential campaign. But as Paul’s poll numbers have sagged nationally — and in such libertarian-minded places as New Hampshire — Cruz is trying to pick off what is sometimes called the liberty vote.

Cruz essentially crashed what was supposed to be Paul’s big libertarian party here, the biennial meeting of the Republican Liberty Caucus. Cruz stood in a hotel here on a dreary Friday morning, surrounded by supporters and curious attendees who held signs and jostled for photos.

“I was elected with tremendous support from the liberty movement,” Cruz said of his 2012 Senate campaign, noting that Rand Paul and his father, former representative Ron Paul (R-Tex.), both endorsed him in that race.

Sen. Rand Paul (R-Ky.) speaks to the Republican Liberty Caucus on Oct. 9, 2015, in Nashua , N.H. (Jim Cole/AP)

The Texas Republican’s presidential campaign has been making the case that as Paul’s campaign has floundered, Cruz is viable — flush with cash and able to go the distance.

On the trail, Cruz has invoked the Fourth Amendment’s privacy protections and railed against the Federal Reserve. Last month, the campaign rolled out a video showing eight supporters of Ron Paul’s 2012 presidential campaign who are backing Cruz for 2016.

“The liberty movement has been integral to our campaign since Day One,” Cruz said.

Cruz breaks down the Republican electorate into four brackets of support: tea party conservatives; evangelical Christians; establishment Republicans; and libertarians. He sees his base in the tea party and evangelical wings, but he also is trying to siphon off libertarian voters with a message of limited government.

Cruz tailored his speech here in New Hampshire to those voters. He took a less hawkish tone when discussing foreign policy, saying that the United States “shouldn’t engage in nation-building” and calling for armed Kurdish ground troops to fight the Islamic State.

“There’s no reason for us to get in the middle of the Syrian civil war,” he said.

Cruz praised the liberty movement as an “amazing thing” and vowed that the size of government will be “materially smaller” if he is elected president. He promoted a bill he co-sponsored to end the bulk collection of phone metadata — an issue that Rand Paul championed this year with a nearly 11-hour Senate floor speech.

“This is the battleground between Cruz and Paul,” said Dave Nalle, a former chairman of the Liberty Caucus. He said Paul appeals to privacy-minded libertarians while Cruz appeals to those who want a strict adherence to the Constitution.

“I was impressed” with Cruz, said Louis Colavecchio Sr. of Wakefield, R.I., who also said he has not decided whom he will support in the primary.

The scramble for supporters seems to have somewhat strained the cordial relationship between the onetime Senate allies. Last month, Paul said Cruz was “pretty much done for” in the Senate after Cruz tried to disrupt the passage of a government funding bill because it would give money to Planned Parenthood.

“Ted has chosen to make this really personal and chosen to call people dishonest in leadership . . . which really goes against the decorum and also against the rules of the Senate, and as a consequence he can’t get anything done legislatively,” Paul said on Fox News Radio. On Friday, Cruz called Paul “a friend” and “good man.”

Paul gave an animated speech here and appeared to be in his comfort zone, saying he wants a government that leaves him alone. He reminded his audience of his marathon Senate speech to defend that principle. He called for reform of the criminal-justice system, and he knocked other candidates for saying they would not hold talks with rival nations. Paul also rapped Congress, labeling a just-passed bill that temporarily funds the government “a bunch of crap” and the body itself “impotent and inconsequential.”

“I’m embarrassed that I’m even a part of it,” said Paul, sporting a bright-blue belt with the University of Kentucky’s logo on it.

Paul played down the threat from Cruz.

“Both here and Iowa, we know where our support is and where my dad’s support was, and we feel comfortable that the overwhelming majority of it is with us,” Paul said.

Some libertarians here were uncomfortable with Cruz making religion such a large part of his campaign.

“I don’t think he’s going to have as much sway on Rand Paul’s electability as people think he will, because he’s a religious zealot. It’s too much,” said Austin Sekel, 22, who is supporting Paul. Cruz “needs to stop grandstanding on the Senate floor,” he said.

Sekel and others said they do not think Paul’s sagging poll numbers will change anything. Sekel thinks Paul has a base of support that has not yet become engaged in the campaign.

Bob Pyle, a pastor from Harrisburg, Pa., said Paul has a “solid, loyal following that is not given to the sounds of throwing red meat.” Between those people and Ron Paul supporters, Pyle said the Kentucky Republican’s fortunes will only increase.

Other people here are not completely enamored of either candidate. Some libertarians have said that Paul has run his race too far from his father’s pure libertarian principles. They include John Cisar, 36, of Burlington, Vt.

“I think there’s a big schism among libertarians that he’s fallen short of expectations,” Cisar said of Paul. Cisar said that he is not a Cruz fan and that he thinks Paul is the more acceptable of the two in the 2016 race.

“He’s the lesser of the evils,” Cisar said of Paul. “And that doesn’t make me feel really good inside to vote for him.”