Rep. Justin Amash (R-Mich.), center, at a news conference this year, has fought other libertarians he sees as bending to President Trump’s will. (J. Scott Applewhite/AP)

House Republicans had a cunning plan. Liberal Democrats, going to extremes, were calling for the abolition of Immigration and Customs Enforcement. Moderate Democrats didn’t want to talk about it.

So in mid-July, the majority introduced a resolution “supporting the officers and personnel” of ICE, and every Republican in the chamber that day voted for it.

Every Republican except Rep. Justin Amash of Michigan.

In a tweet, he denounced the “dubious” claims of the resolution — it suggested that ending ICE would essentially allow gangs to roam free — and asked why his party would “treat a federal agency as though it’s beyond reproach and reform.”

Amash, who is 38 years old and in his fourth term representing Grand Rapids and its exurbs, is often on the losing end of the roll call. A self-described “Hayekian libertarian” — after F.A. Hayek, the Austrian-British libertarian economist — he’s been compared to the Texas libertarian, former congressman and three-time presidential candidate Ron Paul, who embraced the nickname “Dr. No.”

These days, Amash doesn’t even agree with Paul on the direction of the Trump-era GOP. Since the summer of 2015, as his presidential campaign took off, Trump has split the libertarian movement that once largely united behind Paul.

The 83-year Texan’s think tank cheers Trump for fighting “globalists” and questioning the United States’ role in NATO. Sen. Rand Paul (R-Ky.), the elder Paul’s son and Amash’s favored presidential candidate in 2016, has become one of Trump’s defenders, urging him to take security clearances away from some of his critics and saying on the Senate floor that “the hatred for the president is so intense that partisans would rather risk war than give diplomacy a chance.”

That has left Amash as the only consistent representative of a wing of libertarianism that remains alienated by Trump — advocates of a government shrunk down to a pre-New Deal size, and advocates of freer trade and immigration policies.

“I was optimistic until about two or three years ago,” Amash said this week, in an interview at his congressional office. “Things have really taken a turn for the worse, in terms of the growth of libertarianism in Congress. You have some bright spots here and there. But for the most part, the party’s become more nationalistic, more anti-trade.”

The ICE vote was a clear example of how the nationalist branch of libertarianism had won out: Conservatives and almost all of the libertarians who once viewed the Department of Homeland Security and its attendant parts as a dangerous government leviathan had learned to love it.

“It was all ‘owning the libs,’ as they say,” Amash said. “Republicans have been calling for abolishing DHS for a long time. I heard that as recently as the past few years. That was a mainstream, conservative viewpoint.”

Amash, who was elected to a safe Republican seat in the party’s 2010 wave, had initially blended in. Libertarians took note of how he admired Ron Paul; the party’s leaders were pleased to welcome a 30-year-old from the Rust Belt who could make the philosophical case against government spending.

When he gave his first floor speech, in January 2011, then-House Budget Chairman Paul D. Ryan introduced him as an exciting new member of the committee. Amash took the mic and argued that the Affordable Care Act was unconstitutional.

Three months later, Amash voted against Ryan’s budget, citing its spending. After the 2012 election, Amash was removed from Ryan’s committee. When Ryan retires at the end of this year, Amash is unlikely to miss him.

“Right now, in terms of process, we have the worst House speaker in the history of Congress,” Amash said last week.

But for part of the libertarian movement, things have rarely been better. Broadly speaking, modern libertarians fit into two schools of thought. One of them, socially liberal and supportive of open markets and borders, was represented by the D.C.-based Cato Institute, Reason magazine and 2016 Libertarian Party presidential nominee Gary Johnson.

The other, often called “paleolibertarian,” was more nationalistic and often socially conservative; it was represented best by Ron Paul and the Alabama-based Ludwig von Mises Institute, named after the Austrian economist. Trump’s presidency, Amash said, suggested that the Mises school was ascendant.

“Trump’s victory vindicated Ron Paul because Trump used many of the themes that Ron Paul stressed throughout his career, though unfortunately, Trump did not deploy these in a consistent way,” said Lew Rockwell, the founder of the Mises Institute, a former Paul staffer and a member of his think tank’s board. “Opposition to elite control, calls for a pro-American foreign policy that avoids intervention in quarrels that do not concern us, opposition to P.C. and cultural Marxism, and concern with the Fed’s manipulation of the economy are themes straight out of Ron Paul’s playbook.”

Paul was never fully welcomed by the other wing of libertarianism, but he was the most successful political ambassador the movement ever had. His son Rand was embraced by both wings and taken seriously by Republicans when he argued that the party needed to embrace criminal justice reform and question foreign military interventions. Both wings cheered on Trump as he swiped the foreign policy message, attacking the Iraq War at one Republican primary debate while George H.W. Bush, commander-in-chief during that period, watched from the audience. But some libertarians were distraught to see most of Ron Paul’s supporters — people who identified as “libertarian” in polling — go for Trump.

“These were supposed to be the libertarian shock troops, and instead they enabled dim-witted authoritarianism,” said Joey Coon, the vice president of the libertarian-leaning Niskanen Center and a longtime staffer at Cato.

The “paleo” wing has continued to greet Trump as a liberator, rooting on his attacks on the “deep state” and asking why he gets no credit from liberals — or the Cato libertarians — for holding diplomatic talks with Kim Jong Un and Vladimir Putin. Tucker Carlson, who emceed a 2008 Ron Paul rally held the week of the Republican National Convention, now tells his Fox News viewers that “neocon intellectuals” are contradicting the president’s sound, peacemaking instincts.

“If all these peace initiatives succeed, Trump will have reversed the interventionist policies of the Bush II administration, which were continued by Obama, and inaugurated a new era in American foreign policy,” wrote Justin Raimondo, the editor of the libertarian site Antiwar.com, in a column this week. “Now do you get why the Deep State hates him and is trying to overthrow him?”

Amash doesn’t see the world in the same way.

“Are we still droning people? Yeah,” he said. “Are we still running covert operations that weren’t authorized by Congress? Yeah. Is the government still spying on Americans without warrants? Without due process. Yeah. When some libertarians talk about the great accomplishments we’re seeing on foreign policy, I don’t know what they’re talking about. Reaching out to these guys is one thing, but you have to move down the court. He actually made it harder for us to have a good relationship with Russia.”

Amash and the Cato wing have fewer issues with Trump’s regulatory agenda. From the first weeks after the 2016 election, some libertarians who were used to the fringes of Washington were brought inside — most notably Myron Ebell, a climate change skeptic at the libertarian Competitive Enterprise Institute who helped craft a deregulatory agenda at the Environmental Protection Agency. Trump’s judicial nominees, often vetted by the conservative Federalist Society, have also been cheered by libertarians from both factions.

But some libertarians worry that the rest of their agenda is being shelved. Katherine Mangu-Ward, the editor in chief of Reason, said that Trump’s lack of interest in cutting spending or entitlement outlays is familiar to libertarians who remember George W. Bush’s presidency.

“Cries of ‘But Gorsuch!’ abound, and many of Trump top-level appointees have solid libertarian bona fides,” Mangu-Ward said. “But while libertarians like tax cuts, what typically sets us apart from Republicans is that we rather insist on spending cuts to go with them — something Trump has not delivered.” The trade war, she added, was “the stuff of libertarian nightmares.”

In Amash’s conversations with Republicans, there was more frustration with the trade war than many would admit. If Trump had lost the election and Democrats had followed the same agenda, he said, the Freedom Caucus (of which he’s a member) and “all the outside groups would have petitions, demanding we stop Hillary Clinton’s socialist plot.”

But Trump had won the election, and Republicans were not challenging him. That, he worried, was creating a vicious circle — of Republicans sticking with the president, voters hearing them do so and none of them deciding to break from the pack.

In the long run, he said, that arrangement would wound not just the libertarian movement but the Republican Party. When the Pauls had been fighting to change the party, they’d warned that an aging and largely white GOP would lose ground with every subsequent election. Young people, especially libertarians, were no longer seeing a Republican Party they could identify with.

“People who read Hayek, read Ayn Rand, read Bastiat — these people are not going with Trump,” Amash said.