WASHINGTON — A video obtained by NBC News shows U.S. Border Patrol agents attempting to break international law by forcing an injured and mentally unstable man back into Mexico by falsely claiming that he is not in their custody, failing to identify him and assuming he is Mexican because "he looks like it."

U.S. Customs and Border Protection (CBP) provided the video after a whistleblower first alerted NBC News to the existence of the footage. The anonymous videographer was ready to film the encounter because Mexican agents had identified the area as a place where American agents frequently tried to deport migrants covertly, according to a source close to the Mexican government.

The incident occurred at the U.S.-Mexico border in Calexico, California, on March 27, 2017, and sparked a complaint by Mexican officials to CBP, which launched an investigation that ended with the agents being reprimanded, but ultimately keeping their jobs.

Under an agreement between the U.S. and Mexico, Mexican nationals must be properly repatriated through the Mexican consulate, a process that includes fingerprinting and confirming the person's identity. Only then can they be sent back across the border on foot or by other means.

If a migrant is not Mexican, such as the tens of thousands crossing from Central America each month, the migrant must be deported by plane back to his or her home country.

The identities of the persons in the video are unknown to NBC News and CBP is withholding their names for privacy reasons.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

After being deterred by Mexican agents, as seen in the video, the U.S. border agents allowed the man to walk into traffic on the U.S. side of the border.

As ridiculous as it sounds, the laws of our country do not easily allow us to send those crossing our Southern Border back where they came from. A whole big wasted procedure must take place. Mexico & Canada have tough immigration laws, whereas ours are an Obama joke. ACT CONGRESS — Donald J. Trump (@realDonaldTrump) April 3, 2018

Later, and not captured on film, U.S. agents left the man in a park on the American side of the border and lost track of his whereabouts for nearly a month, NBC News has learned. A concerned citizen called the local police when she noticed the man's "erratic" behavior in the park and he was taken to a hospital for evaluation, according to a law enforcement source.

On April 19, U.S. border agents encountered him again trying to enter the U.S. from Mexico. Only then was the man taken to be processed at the Mexican consulate, where it was determined he was in fact a Mexican national and had been arrested 16 times for illegal entry to the U.S. in Arizona, Texas and California, the law enforcement source said.

Without following the proper procedure, the agents had previously been unable to determine the man's identity, if he had a viable case for asylum or whether he had a criminal background.

The breach of protocol would have also allowed CBP to avoid cataloging the apprehension in the agency's database — numbers that President Donald Trump has sought to drive down under his administration to show the rewards of his tough stance on immigration.

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

A spokesman for CBP said the footage captured is an "isolated incident."

But a recent survey by the American Immigration Council of 600 immigrants who were sent back to Mexico found that more than half of the respondents did not receive their repatriation documents and just as many were not asked if they feared returning home, the preliminary question for assessing asylum claims.

The advocacy group's study also found that almost a quarter of the respondents reported being victims of abuse or aggression by U.S. immigration authorities.

Boys look through an older section of the border structure from Mexicali, Mexico, alongside a newly-constructed, taller section, left, in Calexico, California on March 5, 2018. Gregory Bull / AP

In a recent high-profile case involving the deportation of a recipient of DACA, a federal program that has allowed children brought into the U.S. illegally by their parents to remain, Juan Manuel Montes, 23, claimed he was forcibly returned to Mexico by CBP agents in the middle of the night. Montes said in a lawsuit that he was told to keep walking until he found himself on the Mexican side of the border. Montes, who was later arrested for attempting to re-enter the U.S., has since dropped the lawsuit.

Immigration attorneys say that agents failing to follow proper deportation protocol is not new to the Trump administration, but they fear these incidents could become more frequent as agents have been given more power to enforce immigration law against non-criminal migrants.

"Attorneys have seen for years the denigration of legal protections for immigrants at the border when CBP fails to follow proper procedure, including turning away asylum seekers at the border and denying them the opportunity to seek protection and summarily deporting people without due process in clear violation of U.S. and international law," said Greg Chen, director of government relations for the American Immigration Lawyers Association.