Lil Nas X’s viral Old Town Road has broken the Billboard record set by Mariah Carey’s One Sweet Day for most weeks at number one.

The rapper accomplished the feat this week as his country-trap song spends its 17th week on top of the Hot 100 chart.

Carey and Boyz II Men’s duet set the record in 1996, and the only song to come close to breaking it was the ubiquitous international hit Despacito, which tied the 16-week record in 2017.

“YEEE TF HAWWW,” Lil Nas X tweeted on Monday.

Hours later he posted a video thanking his fans for helping his song set a new record.

“I’m on the toilet right now, but I want to say thank you to every single person who has made this moment possible for me. We just broke the record for the longest-running number one song of all-time,” said Lil Nas X, sporting a cowboy hat as he played Old Town Road in the background. “Let’s go!”

Old Town Road, which has achieved most of its success through audio streaming, was originally a solo song but 20-year-old Lil Nas X added Billy Ray Cyrus to the track. The song also has remix versions featuring Diplo, Young Thug, Mason Ramsey and BTS, and Billboard counts the original song and its remixes as one when calculating chart position, thus helping Old Town Road stay on top.

“Seventeen is my new favourite number,” Cyrus said in a statement, also referring to his debut album Some Gave All, which spent 17 weeks at number 1 in 1992.

“My goal was always to make music that would touch people’s lives around the world.”

Old Town Road initially was in a bit of controversy in March when Billboard removed it from its country charts, deeming it not country enough – it peaked at number 19 on the country charts. But the drama did not hurt the song; it only propelled it.

Songs have come close to displacing Old Town Road from the top spot – including Billie Eilish’s Bad Guy and a pair of Taylor Swift singles – but ultimately were unsuccessful.

Swift was successful in 2017 when her song Look What You Made Me Do stopped Luis Fonsi, Daddy Yankee and Justin Bieber’s Despacito from reaching a 17th week at number one.

Celine Dion’s Because You Loved Me ended Carey and Boyz II Men’s epic run in 1996.