Media playback is unsupported on your device Media caption Sheeran said he felt "very proud and happy" in a video message

Ed Sheeran has beaten off competition from Eminem - and himself - to land his first UK Christmas number one single.

Perfect - which he released in three separate versions in a bid to clinch the Christmas crown - had faced a challenge from Eminem's River, on which Sheeran provides guest vocals.

But the rapper ended in second place, while Wham's Last Christmas came third.

In a video message, the British singer said securing the Christmas top spot was "an actual dream come true".

Image copyright Atlantic Records Image caption The video for Perfect riffs on Wham's classic Last Christmas clip

"I'm very proud and happy," he said. "Thank you so much and have a very merry Christmas, happy holidays and a happy new year."

Sheeran's domination of the Christmas chart was all but assured after he released a new version of his doe-eyed ballad with Beyonce.

That version drove most of his sales - though chart rules mean Beyonce is denied a credit on the Christmas number one, with Sheeran's original counted as the lead track.

Eminem's River took an early lead on streaming services but faltered as the week went on.

Media playback is unsupported on your device Media caption Ed Sheeran performs Perfect and Fairytale of New York in Radio 1's Live Lounge

Fans had hoped to send Last Christmas to number one to mark the first anniversary of George Michael's death.

Despite support from ITV's This Morning and Michael's ex-bandmate Andrew Ridgeley, however, the song failed to beat its original chart position of number two.

Back in 1984, it was denied the top spot by Band Aid's Do They Know It's Christmas? charity single.

Christmas chart - Top 5 Artist Title 1) Ed Sheeran Perfect 2) Eminem ft Ed Sheeran River 3) Wham Last Christmas 4) Mariah Carey All I Want For Christmas Is You 5) Rita Ora Anywhere

As has become tradition, yuletide standards by Mariah Carey and The Pogues have returned to the Top 40 off the back of huge streaming figures.

There are 16 Christmas songs in the Top 40, among them such classics as Rockin' Around the Christmas Tree by Brenda Lee and Wonderful Christmastime by Sir Paul McCartney.

The presence of lesser-known tracks, like Ariana Grande's Santa Tell Me and Elton John's Step Into Christmas, can be explained by their prominent placing in Spotify's Christmas is Coming playlist.

"By and large, the most popular ones are the ones featured on the front page of Spotify," chart analyst James Masterton told the BBC.

"It exposes the amount of influence the application has over the singles market."

Mariah Carey's All I Want For Christmas Is You was the UK's favourite festive song on Spotify this year.

And it's not just an advent phenomenon. Data released by the BPI this week showed Carey's classic had been played 16,000 times in the first week of July.

According to Spotify, the most popular day for streaming seasonal songs was 13 December, when 13% of all music played in the UK was Christmas-themed.

Most popular Christmas songs on Spotify (UK) Artist Title 1) Mariah Carey All I Want For Christmas Is You 2) Wham Last Christmas 3) Band Aid Do They Know It's Christmas? (1984 version) 4) Michael Buble It's Beginning To Look A Lot Like Christmas 5) Brenda Lee Rockin' Around The Christmas Tree 6) Shakin' Stevens Merry Christmas Everyone 7) Ariana Grande Santa Tell Me 8) John Lennon Happy Christmas (War Is Over) 9) Justin Bieber Mistletoe 10) Wizzard I Wish It Could Be Christmas Every Day

In the album chart, Eminem's album Revival did manage to dislodge Sheeran's Divide.

It is the star's eighth UK number one album in a row, with his six previous studio albums and the 2005 greatest hits collection Curtain Call all making the top spot.

Led Zeppelin and Abba are the only other artists to accumulated eight consecutive number one albums in the UK.

Revival's first week sales are the second highest of 2017, behind Divide.

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.