Chayce Beckham won Season 19 on Sunday’s three-hour grand finale.

The 24-year-old heavy machinery operator from Apple Valley, , beamed as he played his new single onstage as his fellow competitors danced and rainbow confetti fell all around.

His song, 23, hit number-one on the iTunes country and all-genres charts last week, and to many Chayce’s win may have seemed like a lock.

The winner: Chayce Beckham won American Idol season 19 on Sunday’s three-hour grand finale on ABC

He beat out runner-up Willie Spence, a 21-year-old caretaker from Douglas, Georgia, whose voice was repeatedly called ‘a religious experience’ by several of the judges.

Grace Kinstler, a 21-year-old college student from Lakewood, Illinois, was eliminated earlier and finished in third place.

All of the contestants were tasked with singing four songs for the finale: a song picked for them by the judges, a hometown dedication, a song from the live rounds, and a celebrity duet.

Chayce had been tipped as a frontrunner early on, praised for his gravelly, authentic sound. 

The moment: The top three performed before Chayce was declared the winner

New single: The 24-year-old heavy machinery operator from Apple Valley, California, beamed as he played his new single onstage as his fellow competitors danced and rainbow confetti fell all around

The results: Show host Ryan Seacrest held up the envelope containing the results of viewer voting

Live show: The results were announced by Ryan at the conclusion of the three-hour episode

Split screen: Chayce and runner-up Willie Spence were shownin  split screen as the winner was announced

His battle to get sober won nearly as much attention, as ongoing alcohol abuse led him to a drunken car crash two weeks before auditions and then a commitment to sobriety.

Chayce said of the accident that it was ‘the worst night of my life, followed by some of the worst days of my life,’ calling it, ‘a self-realization moment, having to turn my life around.’

He auditioned for Idol with What Brings Life Also Kills, by Kolton Moore & The Clever Few, and said, ‘Going in there I was a broken person. I came out the other side just a little more healed.’

Sobriety journey: The singer’s battle to get sober won nearly as much attention, as ongoing alcohol abuse led him to a drunken car crash two weeks before auditions and then a commitment to sobriety

The contestant had been open about his sobriety since the crash, something that seemed to have slipped the minds of Luke Bryan, 44, and show host Ryan Seacrest, 46.

Chayce first took to the stage singing a song the judges picked for him: The Beatles’ Blackbird.

Luke loved it so much he promised to take Chayce on a bass-fishing trip they’d long joked about, which thrilled the young contestant.

Top three: Grace Kinstler, Chayce and Willie were the top three going into the finale

‘This may be shocking to you but that might involve some beer,’ Ryan teased, possibly forgetting that Chayce was determined to stop drinking.

‘Whatever,’ Chayce said quietly.’That’s alright.’

‘That’s the point of fishing,’ Luke told Chayce, grinning.

Fishing trip: The contestant had been open about his sobriety since the crash, something that seemed to have slipped the minds of Luke Bryan, 44, and show host Ryan Seacrest, 46

‘Who cares if you fish, as long as it’s icy and cold?’ Ryan agreed.

In a trip back to Apple Valley, http://www.replicate99.com/ Chayce visited his old co-workers and elementary school, and started crying as he realized how he’d managed to turn things around.

His hometown song was Chris Stapleton’s Fire Away, which Lionel Richie, 71, called ‘a great choice.’

Hometown hero: In a trip back to Apple Valley, Chayce visited his old co-workers and elementary school, and started crying as he realized how he’d managed to turn things around

Great choice: The singer’s hometown song was Chris Stapleton’s Fire Away, which Lionel Richie, 71, called ‘a great choice’

‘When we first met you, you kept saying, ‘I’m not sure, I’m not sure,’ Lionel told Chayce.’Let me tell you something: We are sure.’

‘Sometimes God has to turn up the volume on your life to see if you are listening,’ added Katy Perry, 36. ‘And you are listening. So Chayce, keep listening. Stay open. Stay the guy from Apple Valley because your world is about to change.’

Chayce’s third song, Ed Sheeran’s Afterglow, had Katy adding, ‘I don’t think there’s anything left to say… you’re out here playing like a rock star, wearing a satin suit.You had this dream and now you’re living it. Congratulations.’

Volume up: ‘Sometimes God has to turn up the volume on your life to see if you are listening,’ added Katy Perry, 36.’And you are listening. So Chayce, keep listening. Stay open. Stay the guy from Apple Valley because your world is about to change’

For his duet, Chayce joined country star Luke Combs, 31, on Forever After All.

The evening also saw Katy do an emotional performance of her hit Thinking of You with Top 10 finalist Hunter Metts, 22, of Franklin, Tennessee, both of them playing guitar on a dark stage.

Katy and Luke took the night as an opportunity to announce their confirmed summer residencies at Resorts World Las Vegas, alongside Céline Dion and Carrie Underwood.

Her song: Katy performed an emotional performance of her hit Thinking of You with Top 10 finalist Hunter Metts, 22, of Franklin, Tennessee, both of them playing guitar on a dark stage

High five: The pop superstar and Hunter exchanged a high-five

‘She organized it that way because she did not want to be away from me,’ Luke said of his fellow judge, noting that the theater was the ‘newest and the biggest on the Strip.’

‘You can smell his breath and see my pores,’ Katy emphasized.

Céline and Carrie appeared onscreen to wish the finalists luck and tell them to enjoy the ride.

On guitar: Katy showed off her guitar skills during the live episode on ABC

Willie seemed to heed that advice, throwing himself into the performance of the song the judges had chosen for him: Ray Charles’ Georgia on My Mind.

Luke said it was so good he could nearly smell the magnolias and Spanish moss.

‘You have delivered since the day you auditioned,’ he told Willie.’You’ve delivered every single time, and I see you doing that the rest of your life.’

Incredible voice: Willie threw himself into the performance of the song the judges had chosen for him: Ray Charles’ Georgia On My Mind

When Willie went for his hometown visit, everyone came out, from kids wearing his picture on their t-shirts to people leaning out windows and women getting perms at beauty parlors.

His mom Sharon sobbed with joy as she saw him, and his family sang ‘Let the church say Amen’; as he sang for the town, he reveled in their pride and called it ‘the best day of my life.’

His second song was an emotional cover of Sam Cooke’s A Change is Gonna Come, which made Katy cry so hard she could barely speak.

Emotional rendition: His second song was an emotional cover of Sam Cooke’s A Change is Gonna Come, which made Katy cry so hard she could barely speak

‘We are so proud of you,’ she said.’So proud of you, and then seeing you with your mother, it just melted my heart. I love you.’

Sharon, sitting in a wheelchair, said, ‘It’s amazing. I just love him and I’m so thankful for him.’

Willie teared up so Katy ran up with a tissue, her eyes swollen from crying and her face red.

Helping hand: Willie teared up so Katy ran up with a tissue, her eyes swollen from crying and her face red

For his third song, Willie sang Cynthia Erivo’s Stand Up, and had the judges on their feet.

‘We love that voice, and I love where it comes from,’ Luke told him.’You blessed me.’

‘Whether you’re a 1, 2, 9, 8, forget the numbers,’ Lionel said. ‘Your presence on this show has been a religious experience.’

Talented trio: Lionel, Katy and Luke all announced upcoming shows in Las Vegas

Willie then dueted with Leona Lewis, 36, on You Are the Reason, her hit with Calum Scott.

Grace had impressed everyone with her soaring cover of Céline Dion’s All By Myself, the song the judges chose for her.

‘You did not just take that one higher than Céline even sings it!’ Katy said.’Full body chills!’

Hit song: Willie then dueted with Leona Lewis, 36, on You Are the Reason, her hit with Calum Scott

When she went home for her visit, Grace stopped by a baseball stadium at which she’d once sang, saw her mom for the first time in months, and read song lyrics her late dad had written.

‘He just thought I was a star all the time, but that’s because he was my dad,’ she shared.

Her hometown song was Whitney Houston’s I Have Nothing, which she took up two octaves.

Strong cover: Grace had impressed everyone with her soaring cover of Céline Dion’s All By Myself, the song the judges chose for her

Luke was blown away, saying, ‘I wanted to stand on the desk because just a normal standing ovation was not the proper [response.]’

When Grace was eliminated, Katy buried her face in her hands and Lionel seemed to hold his breath, his hands together as though he was shocked into prayer.

To improve the mood in the room, producers brought out Idol auditioner Tom McGovern, 28, a New York City jingle writer who sang ‘Story of the Season’ about the season 19 run.

Fan favorite: When Grace was eliminated, Katy buried her face in her hands and Lionel seemed to hold his breath, his hands together as though he was shocked into prayer

Grace later returned for a duet with Alessia Cara, 24, on Scars To Your Beautiful.

At one point, Luke took Top 10 contestant Casey Bishop, a 16-year-old student from Estero, Florida, to rehearse at Los Angeles’ famed Whisky-A-Go-Go, where he suggested she sing when she was on the show; the two then performed Bon Jovi’s Livin’ On A Prayer together.

Lionel sang his tune One World with Casey, Chayce, Grace, Hunter, Willie, and other Top 10s.

Dynamic duo: Grace later returned for a duet with Alessia Cara, 24, on Scars To Your Beautiful

Rocking out: Luke and Casey Bishop rocked out together

Group effort: Lionel sang his tune One World with Casey, Chayce, Grace, Hunter, Willie, and other Top 10s

Rapper Macklemore opened the show with his hit Can’t Hold Us, joined by the three finalists.

Fallout Boy also showed up to sing My Songs Know What You Did in the Dark (Light ‘Em Up) with Willie, Chayce and Hunter.

The crowd went crazy for Sheryl Crow, 59, singing If It Makes You Happy and Every Day is a Winding Road with Top 10 finalist Graham DeFranco, a 27-year-old pilot from Rockwall, Texas, who Ryan said ‘jumped up there at the last minute.’

Opening number: Rapper Macklemore opened the show with his hit Can’t Hold Us, joined by the three finalists

The show also brought back fan-favorite Murphy, a 28-year-old street musician from Baltimore, whose elimination upset many; he played his own songs Am I Still Mine?and The Painted Man.

Mickey Guyton, 37, performed Black Like Me with Alyssa Wray, the 19-year-old college student and former Top 9 contestant from Perryville, Kentucky.

Chaka Khan, 68, did a medley of her hits with Grace, Casey, and Top 10 finalists Deshawn Goncalves, a 20-year-old college student from Cleveland and Cassandra Coleman, a 24-year-old coffee shop manager from Columbia, South Carolina.

Hit songs: The crowd went crazy for Sheryl Crow, 59, singing If It Makes You Happy and Every Day Is A Winding Road

Lindsey Buckingham, 71, sang Fleetwood Mac’s Go Your Own Way with Cassandra, who played the tambourine.

There was also a montage dedicated to hugging and how much Lionel missed embracing contestants to comfort them, showing him with extended foam arms, and followed by a judges’ hug that led Katy to say, ‘I can smell all of you now.’

In another segment, the judges failed miserably when they tried to guess the words to each others’ most famous songs; Katy was most frustrated when they missed the lyrics for Firework, which she’d sung at January’s presidential inauguration.

During a break, Lin-Manuel Miranda, 41, and director Jon M.Chu of the upcoming film In The Heights announced they would donate $10,000 to an arts program of the contestants’ choice.

Funk queen: Chaka Khan, 68, did a medley of her hits with Grace, Casey, and Top 10 finalists Deshawn Goncalves, a 20-year-old college student from Cleveland and Cassandra Coleman, a 24-year-old coffee shop manager from Columbia, South Carolina

Classic song: Lindsey Buckingham, 71, sang Fleetwood Mac’s Go Your Own Way with Cassandra, who played the tambourine