“I’m so thankful this blessing has been placed upon me.”

Lil Nas’ Old Town Road just became the longest-running number one single on the Billboard Hot 100.

The viral country rap anthem has now spent 17 consecutive weeks at the pole position, beating out Mariah Carey’s and Boys II Men’s collaboration One Sweet Day and Despacito by Luis Fonsi, Daddy Yankee and Justin Bieber.

The song’s success has been boosted on the charts by numerous remixes, the most popular one being the Billy Ray Cyrus version, which became the country star’s first chart-topper in the United States.

Shortly after the news was confirmed, Lil Nas X posted a long essay on social media about the song’s origins.

“I went looking for beats on YouTube when suddenly I came across a country-trap-sounding masterpiece,” he wrote. “I immediately knew I would make something special out of it.

“I jokingly/seriously saw myself as a loner cowboy, needing to run away from it all. I went out on my sister’s porch and listened to the beat over and over. Then it came to me!”

He added: “This song has changed my life and the way I see the world around me in less than a year. I’m so thankful this blessing has been placed upon me.”

Mariah extended her congratulations, writing on Twitter: “Sending love & congrats to Lil Nas X on breaking one of the longest running records in music history!

“We’ve been blessed to hold this record with a song that means a great deal to Boyz II Men and myself and has touched so many. Keep living your best life!”

Earlier this month, Lil Nas X marked the last day of Pride (Sunday 30 June) by addressing his sexuality.

“Some of y’all already know, some of y’all don’t care, some of y’all not gone [fuck with me] no more. But before this month ends I want y’all to listen closely to C7osure,” he wrote alongside a rainbow emoji and a clip of his song C7osure (You Like).

The song he references in the tweet, C7osure (You Like), features the lyrics: “Ain’t no more acting, man that forecast say I should just let me grow, no more red light for me, baby, only green, I gotta go.”

In a later tweet, Lil Nas X highlighted the artwork for his debut EP release 7, which features a rainbow on one of the buildings. He wrote: “Deadass thought I made it obvious.”

Watch the video for Old Town Road featuring Billy Ray Cyrus below.