Kesha, "Rainbow" (RCA)

"I've been through hell and back," Kesha sings on her new album, and even casual listeners are likely to know the circumstances of her trip.

Three years ago, this pop star, famous for her bleary 2009 smash "Tik Tok," filed a bombshell lawsuit against Dr. Luke, the producer and songwriter with whom she'd collaborated for nearly a decade. Kesha accused him of physical and emotional abuse and said he'd raped her; the producer responded with a lawsuit of his own in which he characterized Kesha's claims as an attempt to extort him during a contract renegotiation.

Since then, the legal fight has proceeded agonizingly slowly. What wasn't clear until now is that Kesha feels she made it back from hell.

The singer has been largely unheard throughout her ordeal — the result, she says, of a restrictive agreement with the producer that effectively silenced her. In 2016 she toured for the first time in years but relied on old songs and pointed covers like Lesley Gore's "You Don't Own Me."

She's finally moving again with "Rainbow," her first album since "Warrior" in 2012. It's a vivid account of a woman's unwanted confrontation with a powerful tormentor — "a bogeyman under my bed putting crazy thoughts inside my head," as she puts it in "Learn to Let Go" — as well as her determination to leave the resulting damage behind.

"I could fight forever, but life's too short," she declares to open the record in "Bastards," and what's remarkable is that she makes that conclusion sound like a victory, not a defeat.

"Rainbow" is full of motion. In song after song, Kesha is looking forward, putting more distance between her and the trauma. The album closes with "Spaceship," in which she says her people are coming to take her away: "Lord knows this planet feels like a hopeless place/Thank God I'm going back home to outer space."

This idea of outrunning her troubles may have been the only kind of triumph available to Kesha. Her various court cases are still grinding through the justice system. In fact, "Rainbow" is being released through the record label Dr. Luke founded but he's not credited as a contributor.

Yet Kesha's impressive singing persuades you she's truly found peace by moving on. Her performance in the title track — a lush, Beach Boys-inspired swirl of piano, horns and strings — is the best she's ever sounded: strong and gutsy, but with a trace of the vulnerability you can hear her figuring out how to value again after years of forced defense. A virtual library of emotions, it's not a song anyone familiar with Kesha's stupid-brilliant debut could've seen coming.

And it's not the only one like that on "Rainbow." Kesha roams much more freely here, from the scuzzy garage rock of "Let 'Em Talk" to the swinging neo-soul of "Woman" to the sleek electronic pop of "Hymn."

That sonic jumble can make "Rainbow" feel all over the place, which it is. But right now a coherent story seems less important to Kesha than one in which she has a voice — and one that simply keeps going.

MIKAEL WOOD, Los Angeles Times

new releases

• Grizzly Bear, "Painted Ruins"

• Shelby Lynne and Allison Moorer, "Not Dark Yet"

• A$AP Ferg, "Still Striving"

• Everything Everything, "Fever Dream"

• Ray Wylie Hubbard, "Tell the Devil I'm Gettin' There as Fast as I Can"