US Border Patrol agents were caught on video trying to illegally deport a man to Mexico by claiming he wasn’t in their custody and because he “looked” Mexican, according to a new report.

The incident happened March 27, 2017, along the US-Mexico border in Calexico, California — a spot that agents are known for using to covertly deport migrants, a source close to the Mexican government told NBC News.

NBC obtained video showing the agents trying to coax the shirtless man — who appears disoriented — toward Mexico.

“What I’m doing is, I’m doing him a favor,” one of the agents says on the video.

The person who is filming challenges the agent, saying, “Look at that. You don’t even know if he’s Mexican or not.”

The agent replies, “He looks like it.”

The US agents eventually left the man in a park on the US side and lost track of him for a month, NBC said. The man was taken to the hospital after a woman called police over his “erratic” behavior.

He tried entering the US from Mexico again April 19 — and it was only then that he was taken to the Mexican consulate. It determined he was a Mexican national who’d been arrested 16 times for illegal entry into the US in Arizona, Texas and California, a law enforcement source told NBC.

Mexican nationals must be properly repatriated through the Mexican consulate — which involves fingerprinting and confirming the person’s identity — before they can be sent across the border.

If the person is not Mexican, he or she must be deported to their home country by plane.

The breach of protocol meant US agents were unable to determine the man’s identity, whether he had a legitimate asylum case or whether he had a criminal background.

The US agents involved were reprimanded — but allowed to keep their jobs.

“In the video, our actions were not consistent with our normal procedures,” said Assistant Chief Patrol Agent David S. Kim. “Corrective action was taken to ensure all our agents understand their responsibilities of adhering to established processes, practices, and policies.”

A US Customs and Border Protection spokesman said the footage captured is an “isolated incident.”