South Beach hotel manager was beaten on video. Facebook photos led detective to a suspect.

After an irate guest savagely pummeled the manager at the Riviera Hotel in South Beach last month, detectives seemingly had little to go on.

They had jarring surveillance footage, but the attacker’s face was mostly obscured by a towel. They identified one of the attacker’s friends, but he refused to speak to cops. But that friend did help in an indirect way, police said.

“He forgot he had a Facebook that was open,” said Miami Beach Detective Carlos Corvo.

Corvo said he combed through countless public Facebook photos and the man’s 2,000-plus friends. Corvo found photos of the friend with a man named Tehrron Greene, 22, of Norristown, Penn., who generally resembled the attacker. But that alone wasn’t enough, so Corvo called Greene — who he said promptly admitted to attacking the Riviera hotel manager, as the detective secretly recorded, according to court documents.

“He gave me certain details of the case only [the attacker] would know,” Corvo said in an interview.

Greene was arrested in Pennsylvania on Tuesday, accused of the Feb. 12 attack that severely injured hotel manager Zachary Burke. Greene will now be extradited to Miami-Dade to stand trial on a charge of burglary with battery.

On Wednesday, Greene remained in a Pennsylvania jail. It was unclear if he has a defense lawyer.

Greene has been in the spotlight before, but for more positive reasons. Because of a troubled home life, he successfully attended the Ron Burton Training Village, a camp for at-risk youth, for several years. The camp highlighted his story in a video set to inspirational music.

“My journey has been one continuous struggle,” he said in the 2014 video entitled the “The Journey of Tehrron Greene.”

The episode unfolded at the Riviera, after hotel management suspected that a Pennsylvania man named Marcus Brooks had registered the room with a fraudulent credit card. Brooks, who was with another man and two women, was asked to leave, according to an arrest warrant.

Brooks and the women agreed and walked outside. But the other man, Greene, “became enraged and jumped the counter viciously attacking victim Burke” as the manager tried calling police. The attack happened in a small utility closet next to the counter.

Bruised and his face swollen, Burke is now seeking treatment for a “possible broken orbital [bone] and damage to his left cornea,” the warrant said.

Only Brooks’ name was on file with the hotel. When detectives finally got Brooks on the phone, he refused to speak. After Corvo combed through his Facebook and found Greene, he sent photos to Philadelphia police, who verified his identity, the warrant said.

Another hotel employee then picked out Greene, from a photo lineup, as the attacker, the warrant said. But Greene would not answer his cellphone.

“So I did the next best thing, I called his mom,” Corvo said.

Greene’s mother convinced him to call the detective. Finally, as the detective recorded, the two connected on the phone. According to the warrant, Greene immediately admitted he was was the attacker but that the manager “verbally mistreated him.”

Greene said “he was wrong for what he did but was still wanting to know how he got identified.”

Corvo, with help from the State Attorney’s Office, secured an arrest warrant and flew up to Pennsylvania this week to arrest the man. Greene agreed to speak without a lawyer.

“He gave a full confession,” Corvo said.