A Texas man allegedly shot and killed his employee in the shower — after he found out that the worker had been having an affair with his wife, according to police and a new report.

Edwin Figueroa, 23, has been charged with murder in connection with the slaying of Rafael Nunez Serrano, 22, at the victim’s southwest Houston apartment around 10:20 p.m. Wednesday, police said.

An enraged Figueroa bought a pistol, did cocaine and downed some beer before heading to Serrano’s house — where he shot him in the shower, local station ABC 13 reported. Serrano was wounded but stumbled out into the apartment complex’s parking lot, prompting someone to call 911, according to the report.

As paramedics rushed him to the hospital, Serrano declared that he had been shot by his “boss,” police said. He died in surgery, ABC 13 reported.

Homicide investigators searching the area learned that Houston police officers had detained Figueroa. He was interviewed by detectives and confessed to shooting Serrano, whom he called a friend of about four years, according to police.

Figueroa had previously beaten up Serrano in a fight over the affair, ABC 13 reported.

During his court appearance, Figueroa’s bond was set at $100,000, according to the station. He’s set to return to court Monday.