A federal court in Los Angeles ordered the Trump administration on Tuesday to restore a hotline set up for immigrant detainees that was deactivated after it was featured in an episode of "Orange Is the New Black."

Freedom for Immigrants, the nonprofit that ran the hotline, alleged U.S. Immigration and Customs Enforcement (ICE) shut it down in August after it was mentioned on the Netflix show that featured a character at an immigration detention center.

The character Maritza finds out about the hotline that can be used to get a free lawyer. The nonprofit partnered with the show to portray the plight of immigrants being held in ICE facilities, it said in a statement.

BARR ANNOUNCES SWEEPING NEW SANCTIONS, 'SIGNIFICANT ESCALATION' AGAINST LEFT-WING SANCTUARY CITIES

ICE first restricted the hotline in certain facilities in Florida before completely shutting it down with two weeks of the season seven episode premiere, the group said.

“For too long, ICE has censored our speech and invented imaginary rules to terminate our programs. Today, the court saw through this farce and restored our national hotline,” said Christina Fialho, the co-founder and executive director of the nonprofit.

The agency alleged the nonprofit misused the line by using three-way calling to let detainees speak with family members. The line was not recorded or monitored so detainees could speak with an attorney about their cases.

U.S. District Court Judge André Birotte Jr. issued a temporary injunction ordering the line be restored, saying that the nonprofit’s speech “was a substantial and motivating factor” behind the shutdown.

He noted that detainees were forced to pay $1 per minute to call the group on a new line monitored by the government.

“This case should remind us all that the Trump administration is not a law unto itself, but rather accountable to the people and our Constitution,” Fialho said.

It was not clear when ICE will restore the hotline. In a statement to Fox News, the agency said it doesn't comment on specifics of pending litigation but that it does provide detainees with "reasonable and equitable access to telephones."

CLICK HERE TO GET THE FOX NEWS APP

"Detainees are further allowed to make free calls to an ICE-approved list of free legal service providers for the purpose of obtaining initial legal representation," the statement continued. "Because these legal calls are unmonitored and unrecorded, certain prohibited activities, to include three-way calling and call forwarding, are strictly prohibited.

Messages to the Justice Department were not immediately returned.

The Associated Press contributed to this report.