A federal judge in Brooklyn, N.Y., who has called the Trump administration's immigration policy "heartless," ruled Thursday that a lawsuit seeking to preserve the federal DACA program can continue -- citing candidate Donald Trump's "racial slurs" and "epithets."

In a fiery ruling, U.S. District Judge Nicholas Garaufis, who was appointed to the bench by former President Bill Clinton, shot down the government's motion to dismiss the case.

Garaufis said Trump's "overt expressions of prejudice" during the 2016 presidential election suggest that his attempts to roll back DACA since taking office in January 2017 were unconstitutionally arbitrary and capricious -- a high standard rarely invoked to override executive action.

“One might reasonably infer,” the judge wrote, “that a candidate who makes overtly bigoted statements on the campaign trail might be more likely to engage in similarly bigoted action in office.”

"I’m just glad I was born in Paterson, New Jersey, and not in Mexico City." — U.S. District Judge Nicholas Garaufis

DACA (Deferred Action on Childhood Arrivals) is an Obama-era program designed to delay the deportations of people who came to the U.S. illegally as children. President Trump has expressed interest in ending the program.

The plaintiffs, who include state Democratic attorneys general and other lawyers, won an injunction from Garaufis in February that preserved DACA while the suit proceeded. That injunction resembled an earlier one effected by a California court.

Garaufis' injunction did not require the government to accept new DACA applications. At the time, Garaufis said he was "sympathetic” to those who could not apply in time.

SESSIONS SLAMS 'ACTIVIST JUDGES' FOR NATIONWIDE DACA INJUNCTIONS

Garaufis has a history of taking an unusually emotional, political approach to his cases.

In September, he publicly excoriated a Justice Department lawyer arguing for a DACA renewal deadline.

“This is a democracy; these people have thrived in America, and you can’t just come into court and espouse a position that is so heartless,” Garaufis said in the courtroom. “I’m 68 years old, and I’ve worked in every branch of government, and I’ve never seen a position like this.”

He continued by suggesting that the Trump administration is motivated by xenophobia.

“It’s unacceptable, quite frankly, to me, as a human being and as an American," he said at the hearing. "I’m just glad I was born in Paterson, New Jersey, and not in Mexico City."

WHAT IS DACA, AND WHAT IS TRUMP DOING WITH IT?

In 2013, a New York federal appeals court removed Garaufis from handling aspects of a lawsuit alleging discrimination by the New York City Fire Department, saying he appeared to be too biased.

In that case, Garaufis ordered the department to implement racial quotas, and called evidence of improper discrimination "incredible."

The appeals court found that “an objective observer would have a reasonable basis to question the judge’s impartiality in assessing that evidence at trial.”