A Brooklyn judge has ordered a divorce lawyer into a padded room.

The jurist ruled that the loudmouth lawyer has been terrorizing her neighbors at her ritzy condo building so much — blasting classical music and shrieking things such as “Obama is a murderer!” and “Rape!” around the clock — that her pad has to be soundproofed.

The order is “very unusual — but it’s a testament to just how crazy she is,’’ condo board member Dennis Sughrue, also a lawyer, told The Post about cacophonous counsel Andrea J. Coleman.

Coleman initially had been fined $31,000 for disobeying a court order to keep quiet.

Justice Edgar Walker then came up with an alternative: He would drop the fine if Coleman allowed the board’s acoustical engineer to soundproof her fifth-floor pad at 1 Grand Army Plaza.

In fact, Walker didn’t give Coleman much choice.

If she refuses, the judge has given the board of the Richard Meier-designed tower permission to install the soundproofing “by forcible entry.”

The board is waiting to approach Coleman with its plan because its sound engineer is still devising it, a building source said.

Coleman, 59, started “chronic screaming, ranting and yelling” about two years ago, according to the board’s October 2016 lawsuit.

She bought her one-bedroom unit for $765,000 in 2010. Similar units in the building now sell for over $1 million.

“The screaming and yelling begins as early as 6:30 a.m. and recurs throughout the day and often as late as midnight,” her next-door neighbor, Craig Spolsky, said in an affidavit.

Her “voice can be clearly heard from inside my apartment. She uses words like ‘murder,’ ‘rape,’ ‘killing’ and ‘killing myself,’ and has apparently even mentioned my name in the same breath as these threatening words,” Spolsky said.

“ ‘Obama, the murderer in chief’ — that’s a phrase that she often says,” Spolsky added. “The horrifying nature, tremendously loud volume, and upsetting substance of [Coleman’s] yelling are present nearly every single day.”

He and other residents have called the cops on Coleman several times, but the police claim they can’t do anything unless they can see that she’s a harm to herself or others, Spolsky said.

“If [Coleman] is not going to stop yelling and screaming — and it is clear she will not — there is no other way that her neighbors can co-exist with her on the same floor” without soundproofing, he said.

“There have been times when I have actually fallen off of my chair after being abruptly startled by defendant’s yelling.”

At a court hearing in January 2017, Coleman claimed her neighbors have provoked her behavior. She said they want her out because her unit is in foreclosure. She did not return messages seeking comment.