On the “American Idol” stage Sunday, 16-year-old contestant Caleb Kennedy belted an original song dedicated to his mother. When the song ended, judges Luke Bryan, Lionel Richie and Katy Perry were on their feet in applause.

“You, my friend, are a true anomaly,” Bryan said in his critique, adding that Kennedy’s song sounded like a “wise man wrote it.”

Richie called him “gifted” and said the song will be a “smash record.”

By the end of the episode, Kennedy won a spot in the show’s final five group of contestants.

But Kennedy’s promising future on “American Idol” came to an abrupt end Wednesday after a video circulated online that showed the South Carolina native sitting next to a friend wearing a white hood reminiscent of the garb worn by the Ku Klux Klan.

ABC confirmed that Kennedy would no longer be part of the competition, adding that this Sunday’s episode will feature the top four finalists instead. Kennedy also announced his departure Wednesday and apologized for the video in a statement posted to his social media accounts.

“I know this has hurt and disappointed a lot of people and made people lose respect for me,” he wrote. “I’m so sorry! I pray that I can one day regain your trust in who I am and have your respect! Thank you for supporting me.”

The three-second video, which was sent on Snapchat, shows Kennedy leaning against a wood-paneled wall wearing a blue T-shirt and baseball cap. After one second, he turns his phone to a friend sitting next to him whose face was obscured — except for two cutouts for eyes — by what appeared to be a white KKK hood.

The video went viral when YouTube comedian Def Noodles, whose real name is Dennis Feitosa, posted the video to Twitter at midnight Tuesday. As of early Thursday, the video had 60,000 views.

In a statement to the Spartanburg Herald-Journal, Kennedy’s mother, Anita Guy, said the videos were taken when the singer was 12 years old. She said the clip was not referencing the KKK but rather the movie “The Strangers: Prey at Night.”

“I hate this has happened and how Caleb is being portrayed by people online,” Guy said. “Caleb doesn’t have a racist bone in his body. He loves everyone and has friends of all races.”

On social media, Kennedy said the video “displayed actions that were not meant to be taken in that way.”

“I was younger and did not think about the actions, but that’s not an excuse,” he added. “I wanna say sorry to all my fans and everyone who I have let down.”

A high school sophomore from Roebuck, S.C., Kennedy grew a local audience with his live performances, according to the Herald-Journal, before auditioning for “American Idol” over Zoom.

In the hours since news broke about Kennedy’s departure, “American Idol” swiftly erased Kennedy from its social media platforms. Videos of the singer are gone from the show’s Instagram grid, and even videos from saved story highlights skip over Kennedy. The show’s Twitter feed no longer has posts instructing viewers how to vote for him; his past performances are no longer available on the YouTube channel.

The judges and host Ryan Seacrest have not publicly addressed Kennedy’s departure. ABC has not indicated how the show will handle the news during Sunday’s episode.