Chris Stapleton won the most awards at the 2018 Country Music Association Awards and had the show's best performance, almost capping a perfect night.

That was until Keith Urban surprisingly won the top prize — entertainer of the year — moments before the three-hour show wrapped Wednesday night.

Urban's actress-wife, Nicole Kidman, was in tears as the singer walked onstage to collect the award at the Bridgestone Arena in Nashville, Tennessee.

"Baby girl, I love you so much," he said. "I'm shocked beyond shocked."

Urban last won entertainer of the year in 2005 and also beat out Luke Bryan, Jason Aldean and Kenny Chesney for the prize.

"I wish my dad was alive to see this," the Australian performer said.

Stapleton, however, cleaned house at the CMAs, winning four awards including male vocalist, song and single of the year.

"I want to thank my kids who put up with me being gone quite a bit and not getting to be as a good daddy that I would always like to be," said the father of four and soon to be five, since his wife, singer-songwriter Morgane Stapleton, is pregnant.

Stapleton also won the performance of the night: His supergroup featuring Mavis Staples, Maren Morris, Marty Stuart and his wife gave a soulful and powerful performance of "Friendship," a song made famous by Pop Staples, the iconic singer's late father. They then performed "I'll Take You There," jamming onstage along with a choir. They earned a standing ovation from the audience.

When Stapleton won single of the year — where he won as both a performer and producer — earlier in the show, he said he was "thinking about the people in California right now" and he wants to "dedicate this award to them."

He was referring to the 12 people who were killed at a Southern California country music bar last week, who were also honored at the top of the show when Garth Brooks held a moment of silence as the names of the victims were displayed on the screen.

"Tonight let's celebrate their lives. Let the music unite us with love," Brooks said.

The CMAs, which aired on ABC, also took time to honor those affected by the deadly wildfires in California.

"We send our love to you," said Carrie Underwood, also mentioning the "brave firefighters."

Underwood worked triple-duty as co-host, performer and nominee at the CMAs. She was teary-eyed when she won female vocalist of the year.

"Thank you God. I have been blessed with so much in my life," she said. "Thank you family. Thank you country music. Thank you country music family. ...It's all about family around here."

She kept the positive and uplifting theme of the show going when she gave a rousing performance of her song "Love Wins." It features the lyrics, "I believe you and me are sisters and brothers/And I believe we're made to be here for each other."

Kacey Musgraves, the only woman nominated for album of the year, won the prize for "Golden Hour."

"This is really, really crazy timing — 10 years ago today I moved to Nashville. That's so crazy," she said.

"I'm so proud of it," she said of the pop-leaning country album, which was inspired by Sade, the Bee Gees and others. "It's inspired by this beautiful universe, and all of you, and mostly love."

Dan + Shay lost in all four categories they were nominated in but gave an impressive performance of their hit "Tequila." When Brothers Osborne won vocal duo of the year, John Osborne said, "I thought this was going to go to Dan + Shay. Make some noise for those boys."

"I don't know why we keep winning this," John Osborne said when he first walked onstage.

"If this was in Florida there definitely would be a recount," added T.J. Osborne, which earned laughs from the crowd.

Luke Combs, who has the year's most-streamed country music album, sang onstage with a red cup in his hand and won new artist of the year.

"God, I love country music, man," said Combs.

Brooks performed a touching new song dedicated to his wife, Trisha Yearwood, who was teary-eyed and was hearing the song for the first time. Recent Country Hall of Famer Ricky Skaggs performed alongside Brad Paisley and Urban.

Underwood and Paisley returned as CMA hosts for the 11th time this year, telling jokes at the top of the show, which ranged from Lady Gaga and Bradley Cooper's "A Star Is Born" to Underwood's pregnancy.

Underwood seemingly revealed a secret about the child, saying it will be a "Willie" after Paisley repeatedly asked about the sex of the baby.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.