ALBANY - A video of a Hudson Valley immigration advocate fending off an arrest by an federal immigration agent earlier this month has gained national attention as it shows him debating the officer on the law.

Bryan MacCormack, executive director of the Columbia County Sanctuary Movement, said the March 5 incident in Hudson, Columbia County, with a U.S. Immigration and Customs Enforcement officer will hopefully help people facing deportation by ICE understand their rights.

"I hope it spreads the word about know your rights and exemplifies the behavior that an individual can have when they are being confronted by ICE," he said Wednesday.

The video shows MacCormack debating the law with the ICE officer near the Hudson courtroom where MacCormack had two immigrants in the backseat and was helping them with their legal cases.

The video, taken by one of the passengers, shows MacCormack explaining to the officer that he would need a judicial warrant signed by a judge to search the vehicle and passengers, and he calls his attorney, putting him on speakerphone during the brief incident.

The ICE agent contended he had a "lawful warrant" under the Immigration and Nationality Act of the United States.

The officer asks MacCormack if he's familiar with immigration law that makes it illegal to harbor and transport "illegal aliens," and MacCormack said he is, but that the order the officer provided was only an administrative warrant not signed by a judge.

The video ends soon after, but MacCormack said local police were then called to help with the situation.

Chief Edward Moore told the Times Union in Albany he sent two cars after an ICE agent reported he was meeting resistance from MacCormack and his passengers.

MacCormack's attorney then showed up and ICE ultimately left, an agency spokesperson told the paper.

MacCormack contended local police shouldn't have even got involved because the ICE officer didn't have a judicial warrant, and Hudson has declared itself a sanctuary city, which means it won't enforce certain federal immigration laws.

But Moore told Columbia-Greene Media that he was contacted after the stop and not told the reason for the warrants.

The warrants against the two individuals were for “immigration violations,” ICE told the website.

“I told [the officer] to proceed to the scene with the mission of ensuring public safety as ICE attempts to make their arrest,” Moore said. The officers did not approach the vehicle or assist ICE officers, he said.

Immigration groups and lawmakers in New York, meanwhile, are pushing for legislation called "ICE Out of Courts" that would aim to protect immigrants in the country illegally from being arrested in and around the courthouse.

More:Immigration policy: How New York hopes to keep families together

More:I Leave NY: 190,000 left for other states

More:NY bans questions about immigration status