Nelly was arrested in the St. Louis area Wednesday morning on an alleged drug possession charge, Page Six can confirm.

Missouri State Highway Patrol took the “Hot in Herre” rapper, 49, into custody at 4:45 a.m. local time, according to online records we obtained.

A spokesperson for the law enforcement agency told The Post that Nelly was arrested inside the Hollywood Casino in St. Charles, Mo., after they ran a background check and found an outstanding warrant for not having proof of insurance from a previous traffic stop.

The verification check is reportedly standard for Missouri casinos in accordance with the state’s gaming commission regulations.

Nelly's mugshot.
Nelly, seen here in his mugshot, was arrested for possession of a controlled substance Wednesday.Maryland Heights Police

Nelly.
He allegedly also drove without his insurance at the time of the incident.Instagram/nelly
Nelly, whose real name is Cornell Iral Haynes Jr., was cited with possession of a controlled substance after officers allegedly found him with four ecstasy pills.

The “Ride Wit Me” rapper was also hit with the aforementioned driving without proof of insurance charge, but he has yet to be formally charged pending an investigation from state prosecutors.

Nelly’s lawyer tells Page Six exclusively Wednesday that his famous client was allegedly “targeted by an overzealous, out of line officer.”

“After winning several jackpots, at a venue where Mr. Haynes frequently visits and entertains at its amphitheater; instead of just supervising the transfer of Mr. Haynes’ winnings, this officer felt compelled to needlessly run a check for warrants,” attorney Scott Rosenblum claims in a statement.

Nelly.
Nelly’s lawyer claims the rapper was “targeted by an overzealous, out of line officer.”Instagram/nelly

Nelly performing.
An officer ran a background check on Nelly after he won a jackpot at a casino.London Entertainment / SplashNews.com
“The officer informed Mr. Haynes a background check was mandated when a player won over a certain amount; Mr. Haynes knew this to be untrue as he had won several jackpots for similar or greater amounts including one just a week prior without incident or a background check.”

The lawyer further alleges that the arresting officer “conducted a search without probable cause where he claimed to have found alleged ‘ecstasy’ in Mr. Haynes’ personal property.”

Rosenblum points out that Nelly often travels internationally and is “regularly asked to supply proof of no warrants, including FBI checks.”

He concludes, “I am 100 percent confident this case will go nowhere. And we will be asking for an inquiry into this officer’s conduct.”

A spokesperson for the Maryland Heights Police Department, which booked Nelly, could not be reached.

Nelly.
Nelly allegedly had four ecstasy pills on him when cops pulled him over.Instagram/nelly

Nelly in a suit.
The rapper released a statement via his attorney on the matter.Instagram/nelly
Nelly appeared in a mugshot obtained by Page Six wearing a white T-shirt, a black hoodie and silver chain

The “Dilemma” rapper has not yet taken to social media to address the ordeal.

Nelly’s run-in with the law comes amid an otherwise happy time in the “Country Grammer” rapper’s personal life.

He and Ashanti, with whom he rekindled his romance in April 2023, are expecting their first child together.

“This new year of my life is such a blessing full of love, hope, and anticipation,” the “Foolish” singer, 43, told Essence magazine in April.

Nelly and a pregnant Ashanti.
Nelly is currently expecting his first child with Ashanti.Shakira McQueen / SplashNews.com

Nelly and Ashanti.
The couple rekindled their romance in April 2023.Instagram/@ashanti
“Motherhood is something that I have looked forward to, and sharing this with my family, fiancé, and loyal fans, who have been so supportive of my career, is an amazing experience.”

It was then revealed in June that Nelly and Ashanti, whose full name is Ashanti Shequoiya Douglas, had been secretly married for six months.

A marriage license obtained by Page Six showed the couple tied the knot on Dec. 27, 2023, in St. Louis.