NEW YORK — Sean “Diddy” Combs dropped to his knees and prayed in the courtroom after he was acquitted Wednesday of sex trafficking and racketeering charges that could have put one of hip-hop’s celebrated figures behind bars for life. The rapper and producer, convicted of lesser prostitution-related offenses and still facing prison time, sought his release to await sentencing.

The mixed result capped a sordid legal odyssey that shattered Combs’ affable “Puff Daddy” image and derailed his career as a Grammy-winning artist and music executive, fashion entrepreneur, brand ambassador and reality TV star.

As the jury foreman spoke and the “not guilty” verdicts piled up, Combs pumped his fist. Each juror affirmed agreement with the verdict as Combs looked toward them, holding his hands up in a prayer motion. Then he hugged defense lawyer Teny Geragos. Combs’ relatives and supporters in the audience could barely contain their relief, despite the judge’s admonition to avoid outbursts: When the first “not guilty” was read aloud, someone shouted, “Yeah!”

Combs, 55, later continued to pump his right fist subtly and nodded, seemingly satisfied that he was acquitted on the most serious charges.

Combs was convicted of flying people around the country, including his girlfriends and male sex workers, to engage in sexual encounters, a felony violation of the federal Mann Act.

The charge is punishable by up to 10 years in prison, but Combs’ lawyers said that under federal sentencing guidelines he’d likely face about two years in prison. Prosecutors, citing Combs’ violence and other factors, said the guidelines would call for at least four to five years. Jailed since his September arrest, he’s already served nine months behind bars.

In a triumph for Combs, the jury of eight men and four women acquitted him of racketeering conspiracy and sex trafficking charges related to allegations that he used his money, power and frightening physical force to manipulate his girlfriends into hundreds of drug-fueled sex marathons with the men.

Combs’ defense team argued that the women were willing participants and that none of his violence justified the severity of the charges.

Defense attorney Marc Agnifilo asked that his client be immediately released because the Mann Act crimes were of a “vastly different nature” than sex trafficking and racketeering conspiracy.

Assistant U.S. Attorney Maurene Comey said he should remain incarcerated as a danger to the community and a threat to flee. She cited evidence of physical abuse and “prolific use and distribution of drugs” that emerged during the trial.

“I do believe we’ll be seeking a substantial period of incarceration,” Comey said.

Both sides filed written submissions expanding on their arguments. Judge Arun Subramanian was expected to rule at 5 p.m. EDT on whether to release Combs on bail.

Combs appeared overwhelmed as court adjourned for a few hours. He wiped his face, turning and kneeling at his chair, his head bowed in prayer.

“I’ll be home soon,” he said as he faced his relatives.

“I love you, Mom,” he added.

His relatives applauded him and his lawyers, some of whom had tears in their eyes, as he was led out of court.

There’s no date yet for sentencing, when the judge will decide on Combs’ punishment for the prostitution conviction.

Federal officials involved in the case responded to the outcome by noting that sex crimes “are all too present in many aspects of our society.”

Jurors deliberated for about 13 hours over three days before announcing their verdict. It came after they said late Tuesday that they had decided on four counts but were stuck on the racketeering one. At that point, the judge told them to keep deliberating and keep the partial verdict under wraps.

Combs did not testify at his trial, which featured 34 witnesses as well as video of the rapper attacking his former girlfriend Cassie, the R&B singer born Casandra Ventura.

Her lawyer, Douglas Wigdor, said in a statement after the verdict that “by coming forward with her experience, Cassie has left an indelible mark on both the entertainment industry and the fight for justice.”

Later, he asked the judge in a letter to deny Combs bail, saying “Ms. Ventura believes that Mr. Combs is likely to pose a danger to the victims who testified in this case, including herself, as well as to the community.”

Cassie testified for four days about her turbulent 11-year relationship with Combs, which began after she signed with his Bad Boy record label.

Cassie said Combs became obsessed with voyeuristic encounters, arranged with the help of his staff, that involved sex workers. During the sex events, called “freak-offs” or “hotel nights,” Combs would order Cassie to do things with other men that she found humiliating, she testified.

When things didn’t go Combs’ way, he would beat her, she said.

Another ex-girlfriend, testifying under the pseudonym “Jane,” told the jury she repeatedly told Combs she didn’t want to have sex with the men hired for their trysts.

Nevertheless, she said she felt “obligated” to comply with his demands, in part because he paid her rent.

Combs’ defense team acknowledged that he could be violent but argued that prosecutors were intruding in his personal life. In his closing remarks to the jury, Agnifilo said it wasn’t illegal for Combs to make “homemade porn” with his girlfriends.