A Brooklyn man allegedly attacked a man for having sex with his girlfriend after the three of them agreed to take part in a threesome the day before.

Police told the New York Post that the boyfriend took the leg of a coffee table and bludgeoned the man with it in a fit of jealous rage.

Authorities responded to the incident around 6:45 p.m. Sunday when they found the 31-year-old victim unconscious with life-threatening head injuries.

Officers arrested the boyfriend, 54, and took him to the hospital after he told officials he was having chest pains.

Police say charges against him are still pending.

The man told police that he attacked the victim because he was “raping” his 30-year-old girlfriend, police say.

His girlfriend, however, denied that she had been sexually assaulted and told officers that her boyfriend was wrong.

Law enforcement sources say that the couple agreed to have a three-way with the man Saturday night. The following day, the boyfriend discovered that last night’s threesome turned into a two-person affair.

Upon discovering his girlfriend and the victim in bed together, he struck the man and injured his girlfriend in the process, police said.

The woman suffered minor injuries to her face and lip but was expected to recover.

The victim, however, was in the ICU as of 11:30 p.m. Sunday evening.

In some instances, threesomes that have gone awry have turned deadly. A Florida man allegedly killed a man who invited him over for a threesome during Hurricane Irma in October 2017.

In June that same year, a Brooklyn man allegedly stabbed a man to death for taking part in a threesome with his girlfriend.