NEW YORK (AP) -- In 2014, songmaster Dr. Luke had logged his 16th No. 1 with Katy Perry's "Dark Horse," solidifying his place as pop music's reigning prince of hits, a throne that could only be challenged by one another person -- his mentor Max Martin. He seemed unstoppable.

But the hits came to a halt as Dr. Luke became entangled in a bitter lawsuit with former collaborator Kesha, who accused him of sexual assault during their yearslong partnership, which began when he became her mentor when she was 17. Dr. Luke has vigorously denied the allegations.

His career waned as the case took center stage even before the growing #MeToo movement; female acts stood in solidarity with Kesha, including Kelly Clarkson, Taylor Swift, Adele and Lady Gaga. Feeling the pressure, Perry even released her first major-label album without a Dr. Luke song on it. While Dr. Luke still crafted songs for artists including Ne-Yo, Big Boi, Trey Songz and Tyga, the pop smashes that he had become synonymous with eluded him.

Until now.

Dr. Luke, born Lukasz Gottwald, is marking a comeback with the funky Doja Cat hit "Say So," which topped this week's Billboard Hot 100 chart thanks to its remix featuring Nicki Minaj. The song, produced and co-written by Dr. Luke, is on Doja Cat's sophomore album "Hot Pink," released last November on Dr. Luke's Kemosabe Records.

Instead of using his known stage name, Dr. Luke used the moniker Trevor Trax when credited as the producer of the song, which found major success after TikToker Haley Sharpe performed a dance to the tune on the uber-popular video-sharing platform.

Pitbull, who has collaborated with Dr. Luke on hits like the Kesha-featured "Timber" and "Time of Our Lives," said he didn't even know Dr. Luke produced "Say So."

"No, I didn't. I wouldn't lie to you," the Grammy winner said. "I thought, `Oh man, that's crazy.' But I love the record. All the kids that I'm around, they love the record."

"It was very clever to put it under another name," Pitbull said. "Let's call it a re-charge, re-boost, restart and refresh. He disconnected, deprogrammed and reprogrammed."

Dr. Luke and Doja Cat declined to be interviewed for this story. Sony's RCA Records, which owns Kemosabe, had no comment.

Doja Cat signed with RCA and Kemosabe in 2014, releasing her debut EP "Purrr!" in August 2014, two months before Kesha filed her lawsuit against Dr. Luke.

Press materials for Doja Cat do not mention that Dr. Luke is the mastermind behind "Say So" or four other songs on her album, including the Tyga-assisted bop "Juicy," which peaked at No. 41 on the Hot 100.

When asked if she was surprised Dr. Luke had a No. 1 hit, music journalist Evelyn McDonnell said: "I guess in the sense that he kind of snuck into No. 1, yes."

"The cynic in me is not that surprised because money talks and he is a hitmaker," added McDonnell, a professor of journalism at Loyola Marymount University. "I think if it had been announced as a Dr. Luke song from the beginning that would have gotten the headlines right away."

McDonnell added that the song's success on TikTok helped Dr. Luke take a backseat: "If it had been taken to radio stations...in a normal way, radio stations might have been more reluctant."

Dr. Luke broke on the music scene as a student of Max Martin, the pop music maestro behind early hits for Britney Spears, N'Sync and Backstreet Boys. Martin's white-hot streak has continued since: This year he logged his 23rd No. 1 hit on the Hot 100.

Together, the Swedish creatives crafted smash hits like Clarkson's "Since U Been Gone" and Perry's "I Kissed a Girl," among other triumphs. In 2010, Kesha's debut "Animal," executive produced by Dr. Luke, was released on his label and topped the charts, making Kesha the year's breakout star. The drunken party anthem "TiK ToK" held the top spot for a whopping nine weeks and other Top 10 successes followed.

But the former collaborators have been clashing in courts since 2014. Kesha alleges Dr. Luke drugged and raped her in 2005 and emotionally abused her for years. He claims she smeared him with lies in hopes of getting out of her record contract.

A New York court dismissed Kesha's sexual abuse-related claims in 2016 because of legal issues, without ruling on whether the allegations were true.

Kesha lost another round this past February, when a New York judge said she made a defamatory statement about Dr. Luke on a different occasion: a 2016 text message telling Gaga the producer had also raped Perry. Both he and Perry have denied it, and the judge said there was "no evidence whatsoever" to support the claim.

Kesha's lawyers have filed notice that they plan to appeal the ruling, which also found she owed Dr. Luke over $373,000 in interest on royalties she paid him years late.

But it didn't resolve other aspects of his defamation and breach-of-contract suit, including the crucial question of whether Kesha's allegation that he raped her is true. The judge said that's for a jury to decide at an eventual trial.

"Listen, he was involved in a public scandal," said Larry Rudolph, Spears' longtime manager who has worked with Dr. Luke for years. "There's the court of public opinion and then there's the court of real opinion. Public opinion is often based on little-to-no facts, more emotion-driven. Then there's the court system that's based on real facts. If you look at what happened in the court system, I think you'll find a very different result then what he got caught up a bit in."

Kesha has put out two albums post-lawsuit that were released on Dr. Luke's label but without his creative input.

"Six years is a pretty long time," McDonnell said of the time Dr. Luke went without a pop hit. "Is it long enough for redemption? I don't think so. Not when he's still fighting the lawsuit. That's what's, I think, really troubling."

Theron Thomas, who has co-written hits for Miley Cyrus, Beyonce, Lizzo and Rihanna and frequently collaborates with Dr. Luke, said he was advised to not work with Dr. Luke but decided to do so anyway.

"I feel like if you're going to work with somebody and be with somebody...you got to be with them in the storm and out the storm," he said.

Thomas admits when he first met Dr. Luke, it wasn't pretty: "Our relationship was a bit rocky. I hated him. I thought he was the biggest (expletive) ever."

"The more and more we worked, I understood his reasoning," Thomas added. "It justified it for me. No lie. He was right most of the time."

Thomas said before the coronavirus pandemic hit the United States, he was in Hawaii working on new music with Dr. Luke and Doja Cat.

Pitbull, who is also working on music with Dr. Luke, said he never hesitated in collaborating with him.

"I deal with people for when I'm working with them on the business side. If I'm dealing with you on the personal side and you do something that I think is disrespectful on the personal side, then that's a different story. But if I'm not there to see what goes on, then guess what? We're just going to continue to live with three sides of a story: he says, she says, and the truth," Pitbull said. "I just know what he does musically, how talented he is and how amazing we work together. That's what my business is at the end of the day."