Image copyright Nancy Bundt Image caption Prince's recording engineer says the song was written in an hour

Prince's estate has released the star's original 1984 recording of Nothing Compares 2 U, ahead of the second anniversary of his death.

One of Prince's loneliest songs, it was initially given to his side project, The Family, before Sinead O'Connor made it a hit in 1990.

Prince later reclaimed it in concert, and released a live version of the ballad on his 1993 Hits album.

The song also featured in his last ever show, in Atlanta, on 14 April 2016.

Prince's recording is more ornate than Sinead O'Connor's stripped-down version, and features a heavy guitar riff and a saxophone solo by frequent collaborator Eric Leeds.

But the backing vocals, recorded by the star's on-off girlfriend Susannah Melvoin, are a revelation, providing a harmonic counterpoint to the desolate lyrics.

Melvoin later recorded the first released version of the song with The Family, a band Prince put together in 1984 as a showcase for singer Paul Peterson.

"I'm so blessed and honoured to have been singing background vocals on this," tweeted the singer after Prince's demo was given its first official release on Thursday. "So much love for him."

Prince's version was recorded at the Flying Cloud Drive "Warehouse" in Eden Prairie, Minnesota - the huge rehearsal space he used before building Paisley Park - on 15 July 1984.

It was recently unearthed by Michael Howe, the official vault archivist for the Prince estate.

"I spotted the two-inch multitrack reel in the Vault some weeks back while doing a 1984-era inventory," he said in a press release. "After retrieving my jaw from the floor, we took the reel upstairs, analysed it... and digitised it.

"Even our 'faders up' rough mix was compelling enough to indicate that this was something very special indeed."

Prince's recording engineer Susan Rogers was present for the original recording in 1984.

The star was enjoying "a really happy time in his life" after wrapping up his exhaustive, 98-date Purple Rain tour, she told BBC 6 Music.

"It was a really prolific time. We were doing basically a song a day," she added. "He was very happy."

'Flash of insight'

One day, Prince left the studio holding a notebook and, within an hour, emerged with the lyrics to Nothing Compares 2 U.

"The song came out like a sneeze," said Rogers, noting that Prince wasn't like other musicians, who chisel away at a song until it's finished.

"He worked more like a scientist works. He would have a flash of insight.

"He would then take that flash of insight and he would carry it through to completion without stopping."

Media playback is unsupported on your device Media caption Prince's engineer Susan Rogers and The Family's St Paul Peterson speak to BBC 6 Music

Rogers theorised that the song was written about Prince's housekeeper, Sandy Scipioni, who had been forced to leave suddenly when her father died of a heart attack

"Sandy was the person who made sure he had his favourite beverage, which was Five Alive, and she made sure the house was clean, and that there were fresh flowers on the piano, and that the socks and underwear were washed," Rogers explained.

"She had been gone and Prince's mood was getting darker and darker. He would just ask, 'When is Sandy coming back?'.

"That might have been the inspiration for the song."

Although Rogers felt Nothing Compares 2 U was "exceptional", Prince didn't want to release it himself - perhaps because it was too personal.

"I don't think he ever really intended for this to be released, because it's a guide vocal," Peterson told BBC 6 Music.

"[But] it's incredible to know people around the world will be able to hear what I heard that afternoon at my mom's house when that tape was delivered to me."

The official release of the song is accompanied by a video of Prince rehearsing with his band, The Revolution, in 1984.

It became available two days before the second anniversary of Prince's death, at the age of 57, from an overdose of the painkiller fentanyl, an opioid many times more powerful than heroin, on 21 April 2016.

Prosecutors announced on Thursday that no criminal charges would be brought in relation to his death.

The attorney of Carver County, Mark Metz, said evidence showed Prince thought he was taking the prescription drug Vicodin, when in fact he was taking a counterfeit Vicodin pill laced with fentanyl.

"In all likelihood, Prince had no idea he was taking a counterfeit pill that could kill him," Mr Metz told reporters.

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