Avicii's funeral has taken place in Stockholm.

The Swedish DJ was found dead in Oman on April 20, and his family subsequently released a statement admitting that Avicii - whose real name was Tim Bergling - ''could not go on any longer and wanted peace''.

The private ceremony was staged in Skogskyrkogarden, which is a cemetery in the Swedish capital and it's also an UNESCO World Heritage Site.

Among the attendees at the funeral was Jesse Waits - the American entrepreneur who was a good friend of the 'Hey Brother' hitmaker - who posted an image of the funeral order of service on his Instagram account.

He captioned the shot with a simple love heart emoji.

Joakim Sterner, Avicii's brother-in-law, also attended the funeral, and he posted a snap of himself posing in front of a crucifix.

Avicii's family have not yet revealed the cause of the DJ's death, but in a statement, they admitted he ''could not go on any longer''.

In a letter, which was signed ''The Family'', they explained that the chart-topping star ''truly battled thoughts about the Meaning, Life, Happiness. Now, he could not go on any more. He wanted peace.''

Despite being one of the world's best-known DJs, Avicii took a step back from the spotlight in 2016, when he announced he would no longer perform live.

At the time, the Stockholm-born musician revealed that years of health worries caused by stress and alcohol abuse had led him to take the decision.

Avicii - who was known for his introverted personality - was diagnosed with acute pancreatitis, a potentially life-threatening condition, at the age of 21 due to his drinking habits.

At the time of his death, the star was quietly dating the Czech-born model Tereza Kacerova.