A homeless man charged in the beating death of a musician in Maine mistakenly broadcast the attack live on Facebook, according to a newly unsealed court affidavit.

Donald Galleck, 29, pleaded not guilty Tuesday to depraved indifference murder and intentional or knowing murder in the death of Jason Moody, a 40-year-old bassist for Bangor-based metal band Seize the Vatican, who was found unconscious in the street after an altercation on Nov. 11, the Bangor Daily News reports.

Detectives in Bangor quickly zeroed in on Galleck as someone they wanted to interview about the incident, which led to Moody’s death three days later as a result of his injuries. Galleck, who had no permanent address, was thought to be staying in either Bangor or Old Town, police said.

Galleck was later arrested on Nov. 16 after he was found hiding in an apartment in Bangor. Another woman, Mary Molnar, 33, was also taken into custody on charges of hindering apprehension or prosecution, police said.

Exactly what authorities believe led up to the alleged murder had been sealed since Galleck’s arrest, but more details trickled out during his arraignment on Tuesday, including that the pair got into a spat after Galleck was asked to leave Moody’s apartment following a fight with Moody’s girlfriend, according to the affidavit.

After that, the men went to another apartment nearby where Galleck thought he might be able to spend the night, but that hope was dashed when no one answered the door.

The men then left the Curve Street residence, with Galleck using Facebook Messenger on his cellphone to reach out to another friend as Moody walked behind him, the affidavit states.

The woman on the other end of the line later received and accepted a video chat request from Galleck after he purportedly sent it accidentally while putting his cellphone in his shirt pocket, according to the affidavit.

Galleck’s female friend — who was not identified by the newspaper — told police she then heard “what sounded like someone hitting Galleck” just before the phone switched from voice to video mode.

“’What the f–k?’” the woman recalled Galleck saying, according to the affidavit. “You just hit me!’”

The woman told investigators she then saw Galleck “turn and face the male and punch him once in the face,” prompting Moody to put up his hands and apologize, saying he was drunk.

But that didn’t satisfy Galleck, who struck Moody twice more, sending him to the ground, where he pounced on his inebriated victim, according to the affidavit.

“Once on the ground, Galleck grabbed the victim by the throat and bashed his head off the ground seven times,” the document reads.

Galleck soon fled the scene, seemingly jumping a fence after leaving Moody unconscious. Galleck’s friend then ended the video call. It’s unclear whether the footage was saved on Galleck’s device or if it had been retrieved by investigators, according to the Bangor Daily News.

A coroner found that Moody died from “massive inflicted trauma” to his brain.

A judge tentatively set a trial date for Galleck, who remains held without bail, for March 2020, the newspaper reports. If convicted, he faces a maximum of life in prison.