Customs and Border Protection Commissioner Chris Magnus, confirmed by the Senate by a razor thin margin, now has to overcome stiff opposition from hard-liners — and even some Border Patrol agents — over President Joe Biden’s immigration policies.

The former police chief of Tucson, Arizona, has been sharply called out on his support for sanctuary city policies and opposition to former President Donald Trump’s border wall, the Washington Examiner reported.

He’ll take on the job amid record high Border Patrol arrests for illegal crossings at the southern border.

“Magnus is simply the wrong person for this critical federal law enforcement position,” Mark Morgan —Trump’s acting border commissioner and now fellow at the Heritage Foundation and the Federation for American Immigrant Reform — told the news outlet.

“He refused to call the crisis what it is, a crisis, and only grudgingly admitted that the Biden administration’s policy of nonenforcement might be driving the crisis,” Morgan added, the Washington Examiner reported.

“In past testimony, he has called the border wall system a ‘medieval’ solution to border security despite the men and women of CBP across the board saying such a system works. And he simply does not have the professional experience to lead the more than 62,000 men and women of CBP — the largest federal law enforcement agency in the country.”

In a statement, FAIR head Dan Stein also criticized the pick, arguing it’s a sign Biden plans to continue his efforts to open the border and dismantle Trump’s policies.

“Throughout his tenure as Chief of Police in Tucson, Arizona, Magnus was a staunch defender of sanctuary policies that undermine some of the very laws that he is about to enforce,” Stein wrote. “As the Border Patrol is overwhelmed with record numbers of people crossing our border illegally – compounded by vast amounts of lethal drugs being smuggled into our country – the men and women who serve in that agency deserve a leader who will provide them with the proper support and resources they need to protect the American people.

“Chris Magnus is most assuredly not that guy. He was nominated by President Biden not to ensure that our borders are secure, but to see to it that his administration’s open-borders policies are carried out regardless of the cost or risk to the American public.”

Before winning Biden’s nomination, Magnus, the first openly gay man to be commissioner, was profiled by the New York Times as a Trump critic who once carried a Black Lives Matter poster in a protest.

“Sometimes it’s frustrating how hyperpartisan all these issues can become, but I want to say from the very start, I am no ideologue and I do want to make a difference on things,” Magnus told the Times in April.