Kendrick Lamar
Kendrick Lamar at the 2013 BET AwardsReuters

Days after breaking a Spotify record, Kendrick Lamar's new album To Pimp A Butterfly has scored him his first UK number one album.

The American hip hop star's third full-length studio album managed to dethrone Sam Smith's In The Lonely Hour after it debuted at the top spot.

Coming in at number three is rock veteran and Dire Straits star Mark Knopfler with his eighth studio opus Tracker, while Ed Sheeran's X occupies fourth place. Van Morrison rounds off the top five with Duets - Re-working The Catalogue.

Earlier in March, To Pimp A Butterfly, which features tracks about racial injustice and economic inequality in the US, made Spotify history after racking up more than 9.6 million streams in just one day. It was also named the most-streamed album in the UK top 40, earning 3,722 streams in a week.

The deeply introspective record is the follow up to 2012's Good Kid, m.A.A.d City, which spawns hits such as B***h, Don't Kill My Vibe, Poetic Justice and Swimming Pools (Drank).

Lamar's new record, which features collaborations with Snoop Dogg, James Fauntleroy and Ronald Isley, managed the impressive feat despite being unveiled a week ahead of schedule.

To Pimp A Butterfly had been earmarked for a 27 March release but Anthony Tiffin, CEO of Lamar's music group Top Dawg Entertainment, claimed record label Interscope released it early accidentally. Tiffin tweeted earlier this week:

"I WOULD LIKE 2 PERSONALLY THANK @Interscope FOR F*****G UP OUR RELEASE... SOMEBODY GOTS 2 PAY 4 THIS MISTAKE !!!! #TOP. This is the kraziest s**t ever."

While Smith may have to settle for second place on the UK album chart, he is still reigning supreme on this week's official singles chart. The British pop star is still at number one with Lay Me Down, his collaboration with John Legend for Comic Relief. It had a lead of 9,000 combined chart sales over Years & Years' King on Sunday 22 March.