Racist lawyer Aaron Schlossberg will have to find new office...

The Midtown lawyer caught yelling racist comments at Spanish-speaking restaurant workers in a viral video was treated like a pariah by fellow attorneys at a Queens court Thursday, lawyers there told The Post.

“I noticed him because of that clip online,” one attorney at the Supreme Court in Long Island City said of Aaron Schlossberg.

“I was taken aback that he would have the balls to come to court in front of all of his colleagues after his crazy outburst.”

Another legal eagle added: “Why would he do that? His reputation will be shot. What a dope!”

Schlossberg was there representing Queens medical center Aimes Enterprises Inc. — a day after footage emerged of the lawyer threatening to have workers at a Manhattan eatery “kicked out of my country.”

Aimes Enterprises chief Tom Major later told The Post he was totally unaware of Schlossberg’s viral rant — and had never heard the attorney say anything racist.

“This is the first time I’m aware of something like this,” he said.

Schlossberg has at least four other cases pending in the state civil court system, records show — three of them for film producer and real estate investor Todd Courtney.

Courtney, who is listed as an executive producer for 2015’s “Beasts of No Nation,” said Thursday morning he was also unaware of Schlossberg’s outburst and didn’t have any immediate comment on whether he will continue using his services.

Schlossberg is representing Courtney in two disputes regarding a Downtown building where he previously owned a condo — and is also repping his production company Mammoth Entertainment in a suit against the Global Citizen music festival over payment for documentary footage, records show.

The fourth case is for Upper East Side record label Niche Music Group in a suit against Orchard Enterprises and Sony over royalties.

A former client of Schlossberg’s said he’d witnessed the lawyer’s bad temper — but not any bigotry — and stopped using him last year.

“We had a bad relationship with him. He’s that kind of person,” said Gennadiy Kosyakovskiy, whose company Genial Management was employing Schlossberg in a lease dispute before switching attorneys in September, court records show.

“When we stopped working [with him], he start screaming and all this stuff.”

Niche Music didn’t return requests for comment.