After four years and an ugly legal battle with her former producer, pop singer Kesha has returned to music and has a message for her fans.

“Praying,” her new single, was released with a music video Thursday.

Rolling Stone reported that the song is the first solo one she's released since 2012 and will be on her upcoming album, "Rainbow."

>> Read more trending news

The singer teased the new song in a Twitter video Wednesday.

“You’re support and love and kindness has gotten me through hands down the hardest time of my entire life,” she said in the video.

The song is particularly poignant because Kesha has been in a legal dispute since 2014 with her former producer Dr. Luke, who is currently the head of Kemosabe Records -- the record label Kesha is signed to, according to The Los Angeles Times.

Related: Why are celebrities tweeting #FreeKesha?

In the since-dropped sexual and emotional assault lawsuit she filed against Dr. Luke, born Lukaz Gottwald, Kesha, born Kesha Sebert, claimed she was sexually and physically assaulted. In 2016, that suit, filed in Los Angeles, was dismissed to focus on her suit against Dr. Luke in New York, in which she alleges she was drugged and raped.

Luke has denied the claims in the suit.

At the time, Kesha said she dropped the suit as part of an effort to get her music out.

Related: Singer Kesha drops sexual assault lawsuit against producer Dr. Luke

Celebrities and fans alike showed support for the singer with the hashtag #FreeKesha.

The music video for the piano-driven balled goes between black-and-white and colorful scenes. It opens with the singer laying in a coffin and switches to a black-and-white scene of her laying in a body of water on what looks like a makeshift raft.

“If I am alive, why? If there is a God or whatever, something, somewhere, why have I been abandoned by everyone and everything I've ever known? I've ever loved? Stranded. What is the lesson? What is the point?” the singer says at the opening of the video. “God, give me a sign, or I have to give up. I can't do this anymore. Please just let me die. Being alive hurts too much.”

Kesha shared her thoughts on the new single and the last few years in a post on actress Lena Dunham's website, Lenny Letter.

“This song is about me finding peace in the fact that I can't control everything -- because trying to control everyone was killing me,” she wrote. “It’s about learning to let go and realize that the universe is in control of my fate, not me. ...”

“‘Praying’ was written about that moment when the sun starts peeking through the darkest storm clouds, creating the most beautiful rainbow. Once you realize that you will in fact be OK, you want to spread love and healing. ...”

“This is just the beginning. I am so happy and grateful to begin sharing all the music I have been writing with the world. I've written a record that reveals my vulnerabilities, and I have found strength in that.”

Kesha’s new album, “Rainbow,” which will include “Praying,” will be released Aug. 11.

Watch the “Praying” music video below.