The arrests of undocumented immigrants in and around New York courthouses has skyrocketed by more than 1700% since Donald Trump became President, according to elected officials and advocacy groups.

"The courthouse is no longer a place of safety and justice, it is a trap," said Brooklyn District Attorney Eric Gonzalez.

Now, they've filed two federal lawsuits against the Department of Homeland Security, which oversees Immigration and Customs enforcement.

The suits argue ICE agents have arrested 400 undocumented immigrants, as well as those who are legally here, at courthouses since January 2017.  State Attorney General Letisha James says ICE is violating New York's rights and laws to run its courthouses.

"ICE's enforcement action undermines the effectiveness of the court system as a whole, making it harder for the state to carry out its critical law enforcement function," James said.

They want a federal judge to order ICE to stop these sort of arrests.

The Trump Administration has taken a hard stance on deporting undocumented immigrants who have committed crimes.

The Brooklyn district attorney says he's had to drop cases because witnesses and victims are afraid to come forward.

"Calls to our Immigrant Affairs unit, a unit tasked with assisting immigrants in our city, who are victims of crime have decreased by two-thirds from 2016," said Gonzalez.

It’s easy for ICE to track down people they are looking for by accessing court records.

The Legal Aid Society has often protested outside of courthouses when ICE arrests its clients.

The organization says a sex trafficking victim fighting a case decided to be locked up when she found out ICE was in the courtroom.   

"In order to have that person from being taken, we had to ask for bail because, in that moment, Rikers was more protective of her rights," said Tina Luongo from the Legal Aid Society.

Homeland Security says it tries to avoid sensitive locations— places like hospitals, schools and houses of worship—when making arrests. Under current policy, a courthouse is not a sensitive location.

Homeland Security says courthouse arrests are necessary because of the unwillingness of some jurisdictions to cooperate with ICE in transferring people from their jails and prisons.

Advocates say the immigrants often arrested have committed minor crimes or violations.