Twenty-seven years after Billy Ray Cyrus scored a crossover hit with “Achy Breaky Heart,” the country star has lassoed another smash success as a featured vocalist on rapper Lil Nas X’s “Old Town Road (Remix).”

This week the song tied the record for the longest-running No. 1 single in Billboard Hot 100 history. At 16 weeks, it shares the honors with Mariah Carey & Boyz II Men’s “One Sweet Day” and “Despacito” by Luis Fonsi featuring Daddy Yankee. It also racked up seven nominations for the MTV Video Music Awards (Aug. 26).

Here, Miley’s 57-year-old dad — who also has a new collaboration, “Chevys and Fords,” with Johnny McGuire — traces his unlikely journey with “Old Town Road (Remix)” to the record books.

Congratulations on the massive success of “Old Town Road (Remix).” Did you ever see this coming?

[Laughs.] How could you ever see this coming? To be 16 weeks at No. 1, it’s not a thought that even came close to crossing my mind. But that being said, I just loved this song, and I thought the song just brought people together from all walks of life . . . It was really just a beautiful thing to be a part of, and I’m so glad that this song came into my life. It’s been a ride like no other. It’s like a magic horse, and it just kept running, man.

How did you end up hooking up with Lil Nas X in the first place?

He actually sent out a tweet in December, before he had signed to Columbia [Records], and said, “Does anyone know how I can get this song to Billy Ray Cyrus?” It didn’t reach my ears until March 14, when I got a message from Columbia Records that a young man by the name of Lil Nas X wanted me to hear his song “Old Town Road,” and would I consider singing on it. And so I said, “Well, who is Lil Nas X?”. . . But I fell in love with it just like everybody else did.

What did you think about the fact that, before your remix was released, the single was disqualified from the Billboard Hot Country Songs chart for not fitting the genre enough?

When I saw that happen, I wrote to Lil Nas on Twitter, and I said, “Waylon Jennings told me, ‘What is the definition of an outlaw? One who has been outlawed. Welcome to the club.” But music fans were smart enough to see through that, and they said, “We don’t need nobody to tell us what we like.” Like Lil Nas says, “Can’t nobody tell me nothin’.” This song became the power of the people. It feels more like a movement.

Did you ever thing you would perform at the BET Awards, like you did with Lil Nas X in June?

I’m so grateful for that experience. It was one of the greatest nights — and funnest nights — of my life. Just being a part of that show . . . the reception was just so special. I’ll always cherish that night . . . I wish I would have been invited a long time ago, ’cause it’s the best party in town!

Are there any other rappers or other young artists you would like to collaborate with in the future?

You want me to be really honest with you? I was thinking about retiring, because to me this is the perfect way for me to go out. For years and years, I said, “Man, if I could ever just make it back to the top, I think I’d love to just retire and quit at the top,” never dreaming it could ever even be close to possible. Lo and behold, this ride happens and . . . there’s been so many great ideas coming at me. That’s why I’m not gonna retire, because I now have a whole ’nother album of some ideas with some people I’d love to make some music with. And it turns me on.

What are you looking forward to most about the VMAs?

On Aug. 25, I turn 58, so I’m gonna start my life as a 58-year-old man at that awards show. It’s just the perfect place to be. I love this story.