Meghan Markle and Prince Harry surprised concertgoers at Elton John's final show Sunday night before his retirement.

The Duke and Duchess of Sussex thanked John for "being a friend" to them, their children and Harry's late mom Princess Diana in a pre-taped message.

"Hi Elton, we just wanted to say congratulations," Markle said in the video, according to People magazine.

"And thank you for entertaining everybody for so many decades," Harry added. "Thank you for being the friend that you were for my mum, thank you for being our friend. Thank you for being a friend to our kids and thank you for entertaining people right around the world."

Elton John plays the piano

Elton John bid farewell to Dodger Stadium on Sunday night. (Getty Images)

ELTON JOHN HONORS QUEEN ELIZABETH DURING TORONTO CONCERT

Elton John at Meghan and Harry's wedding

Elton John waves as he leaves the wedding ceremony of Prince Harry and Meghan Markle at St. George's Chapel at Windsor Castle on May 19, 2018. (Chris Jackson/AFP via Getty Images)

"Even though this is officially your retirement, this will not be your last gig, we know that. But we love you and congratulations on an incredible career," he finished.

Prince Harry and Markle have long been friends with John. The musician performed at the couple's wedding in 2018.

The concert, which streamed live on Disney+, was the last of a three-night stand at the stadium (and his 103rd show in the LA area, he told the crowd). The Farewell Yellow Brick Road tour began in September 2018 with the first of the 300-plus scheduled dates. It was suspended in 2020 because of the COVID pandemic and resumed in 2021.

For the concert Sunday night at Dodger stadium, John was joined by musicians Brandi Carlile, Kiki Dee and Dua Lipa.

The crowd of more than 50,000 roared at the moment in the last minutes of the final North American concert of a tour John says will be his last.

"I want to spend time with my family because I’ll be 76 next year, he said. "I want to bring them out and show you why I’m retiring."

Dua Lipa at Elton John's concert

Dua Lipa attends the Disney+ "Elton John Live: Farewell From Dodger Stadium" at Dodger Stadium on Nov. 20, 2022. (Michael Tullberg/Getty Images)

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Elton John on stage

Elton John wore a bedazzled sport coat in honor his iconic Dodger look. (Michael Kovac/Getty Images)

He embraced and kissed his husband, David Furnish, while his two sons, 11-year-old Zachary and 9-year-old Elijah, wearing matching Dodgers jackets that read "Elton" on the back, waved gleefully at the crowd.

John then broke into "Goodbye Yellow Brick Road," the inevitable final song that gave the tour its name.

In January, John heads to Australia and New Zealand, then moves on to Britain and Europe. He's set to conclude in Sweden in July, though he's made it clear he is only done traveling, not making music.

Elton John sings

Elton John plays the piano on stage, Nov. 5. (Michael Kovac/Getty Images for LACMA)

CLICK HERE TO GET THE FOX NEWS APP

The Associated Press contributed to this report.