Miley Cyrus has released a song in memory of her beloved rescue dog Mary Jane.

Pitbull MJ and Miley Cyrus (c) Instagram

Pitbull MJ and Miley Cyrus (c) Instagram

The 'Prisoner' singer has been left heartbroken after the pitbull mix lost its year-long battle with cancer and she has shared a song she penned in tribute to her canine companion before her passing.

Miley hailed the animal as “more than a friend or family member” and said they shared an “incomparable love”.

In a post on her Instagram Story, Miley said: “Anyone knows me & it doesn’t have to be well is aware that my best friend in the whole world is a rescued pit bull mix named Mary Jane.

“MJ was diagnosed with cancer over a year ago …. & since then multiple types and tumors. I was told it’d be an uncertain amount of time until she’s gone. Advised to spend every second savoring her special spirit…. which wasn’t anything new. I had been for 10 years.

“I thanked her repeatedly as she took her last breath for who and what she has been to me. It was something more than a friend or family member. Something so different. You can’t define it. Our connection was purely DIVINE. An incomparable love.”

The 28-year-old star - who released her latest studio album, ‘Plastic Hearts’, in November - wrote 'Mary Jane 5EVR', which deals in "loss and heartache", when she lived in Malibu in her house that got destroyed in the devastating wildfires of 2018.

On the song, which she shared as an IGTV, she wrote: “I wrote this song in Malibu years ago on a piano in a house that no longer exists. About my dog Mary Jane who is also gone now. A lot has changed over time. Mostly me. Music is my medicine. This song revolves around loss & heartache. Which I am currently experiencing after Mary Jane’s passing (sic)."

The 'Midnight Sky' hitmaker adopted the pooch in 2012 when she was dating actor Liam Hemsworth, who she divorced in 2019.