Ed Sheeran
Ed Sheeran originally wrote Justin Bieber's Love Yourself for Rihanna Jamie McCarthy/Getty Images

Justin Bieber landed a number one hit with his single Love Yourself but it could have sounded very different. Singer Ed Sheeran reveals that he originally wrote the song for pop star Rihanna and the lyrics were not so child-friendly.

Love Yourself, a guitar-led ballad, spent six weeks at number one in the UK following its release in November 2015. In an interview with Sirius XM's Howard Stern, Sheeran, 25, explains how he penned the track with Rihanna in mind.

The Shape Of You singer said: "[I was] hearing Rihanna... coming in with a bit of that swag. Rihanna could get away with saying 'you should go and f**k yourself,' in my mind anyway. It kind of came at a zeitgeist time for his [Bieber's] career, where he had fallen out of grace with the public, and he had this comeback song that was quite grown up."

Love Yourself narrowly missed out on claiming the Christmas number one after losing out to the NHS Choir. However, it did return to the top of the charts and had sold 719,000 copies as of January 2016. Sheeran previously revealed that Love Yourself was also meant to appear on his third album Divide, released on 3 March, but it did not fit in with the tracklist.

The 26-year-old told Carson Daly: "That was a song I had written for Divide. It just wouldn't have made it. So going from a song that would have never been released to [being] the biggest song of last year – it just became Billboard's #1 of 2016 of the whole year, and nominated for Song of the Year at the Grammys – it just shows you that you shouldn't always write stuff off."

Rihanna
Rihanna's version of Love Yourself would have been slightly less child-friendly according to Ed Sheeran REUTERS/Mario Anzuoni

Instead, Love Yourself appeared on Bieber's Grammy-nominated album Purpose, which hosts the hit singles What Do You Mean?, Where Are U Now and Sorry.

Sheeran is no doubt bracing himself for celebrations as Divide is on course to top the UK charts, becoming the best-selling album of 2017 so far. According to the Official Charts Company, Sheeran is expected to sell more than 500,000 units by 10 March and will amass the biggest opening week album sales since Adele released 25 in 2015.

Listen to Justin Bieber's Love Yourself: