A former Westchester cop charged in four drug-related killings was released from solitary confinement — only to be greeted with threatening catcalls that got him tossed back in the hole for his own protection, his lawyer said Tuesday.

Ex-Briarcliff Manor cop Nicholas Tartaglione was sent to the “Special Housing Unit” in the federal Metropolitan Correctional Center in Lower Manhattan after getting caught with a cellphone on July 3.

The hulking bodybuilder finished up his 75-day punishment on Monday and was being transferred back to general population when fellow inmates spotted him and began yelling, “That’s the cop!”, defense lawyer Bruce Barket said during a hearing in White Plains federal court.

Correction officers hustled Tartaglione back to the SHU, where he spent the night, Barket said.

Tartaglione, 51, wants to be transferred to a unit where he’ll be safe but can also get regular visits from his family, which he can’t have while locked up in the SHU, Barket said.

The federal Bureau of Prisons didn’t immediately return a request for comment, and it was unclear where Tartaglione will be housed following his return from court.

During Tartaglione’s time in the SHU, he was the cellmate of convicted pedophile Jeffrey Epstein and came under scrutiny when Epstein was found nearly unconscious with marks on his neck on July 23, two weeks before authorities say he committed suicide by hanging.

Epstein told prison officials that Tartaglione “roughed him up,” a source familiar with the matter has told The Post, but Tartaglione was cleared in the incident, Barket has said.

Tartaglione has claimed he was harassed by correction officers following Epstein’s death, but there was no mention of the late financier and alleged child sex trafficker during Tuesday’s court hearing.

Tartaglione faces the death penalty in what authorities have called the “gangland-style” slayings of four men on April 22, 2016, as part of a conspiracy to sell more than five kilos of cocaine.

The killings were allegedly committed after the victims — Martin Luna, his nephews Miguel Luna and Urbano Santiago, and pal Hector Gutierrez — were lured to a since-shuttered bar, the Likquid Lounge in Chester, that was run by Tartaglione’s brother.

Their bodies were found in December 2016, buried on property Tartaglione formerly rented in nearby Otisville.