NEW YORK — It’s one sweet day for Lil Nas X: The breakthrough rapper’s viral “Old Town Road” has broken the Billboard record set by Mariah Carey’s “One Sweet Day” for most weeks at No. 1.

Lil Nas X accomplishes 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.

“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.

“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 No. 19 on the country charts). But the drama didn’t 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 No. 1. Celine Dion’s “Because You Loved Me” ended Carey and Boyz II Men’s epic run in 1996.