A homeless man beaten into a coma by a baseball bat-wielding attacker has died of his injuries more than a year-and-a-half later, cops said Wednesday — and the accused attacker admitted to cops he confronted the victim for urinating and defecating in the suspect’s apartment building.

James Cole, 58, died Nov. 11 after clinging to life for nearly 20 months, since Matthaat Blomont allegedly bashed him in the head with a bat and stomped him outside a laundromat next to the suspect’s Flatbush apartment building.

Blomont has been held without bail since his arrest and indictment on attempted murder and assault charges a few weeks after the beating. He could now face upgraded charged in the wake of Cole’s death, which has been deemed a homicide after an autopsy by the city Medical Examiner.

After his arrest, the suspect told cops that Cole had been “pissing and s–ting” in Blomont’s building on Bedford Ave. near Clarkson Ave. The building’s super blamed Bomont, the suspect said, according to court filings.

“He was in the building…. And he was like yo get the f–k out of my face and he cut me with a blade,” Blomont said in a rambling interview with detectives on April 11, 2024, in which he admitted confronting the victim but claimed he wasn’t present when Cole was attacked. “(I) left it alone and I walked away… When I came back I saw an ambulance. I said ‘Oo, he’s on the floor’ and I stood there. Yes, I stood there with the police. I’m serious.”

Blomont then admitted he “was there with the bat” but claimed he didn’t use it, telling detectives at separate points in the interview he put the bat on the ground, it fell, and he threw it away near a tree, according to court filings. He also said a woman at the scene told him to back off, so he did.

“I’m being honest with you. I walked off. I went to get a coffee,” he said. “I was just telling him not to come in the building, that’s it.”

Blomont then admitted to pushing Cole but insisted he didn’t hit him, according to court documents.

“I came outside. I saw him and said, ‘Why are you in the building?’ I said, ‘The landlord said you pissed and s— and break the locks,” Blomont said. “I didn’t hit him. (The bat) fell I’m telling you. It fell under the car. He threw bags at me and (the bat) was rolling and I just left it.”

An eyewitness saw Blomont repeatedly hit Cole in the head with the bat, then repeatedly stomp his head while he was on the ground, according to the complaint. A law enforcement source said the beating was also caught on video.

Cops initially couldn’t identify the unconscious victim, though investigators determined who he was after he admitted to Kings County Hospital with severe head trauma, a police spokeswoman said.

The beatdown left Cole in a coma and he needed a ventilator to breathe, according to the criminal complaint.

The Legal Aid Society, which is representing Blomont, declined comment Wednesday.