8:30 AM PT -- DMX has been released from jail, but there's a catch ... law enforcement tells us he's been placed under house arrest. It's unclear at this point how long he'll have to stay home.
And for the record ... DMX tells TMZ he was totally unaware there was any weed in the car. 7:44 AM PT -- According to the police report, obtained by TMZ ... DMX smelled like he was drunk and was in possession of WEED at the time of the arrest.
Cops say X was a passenger in an F350 truck that made an illegal lane change. When they stopped the ride, cops say they found a bag of weed sitting on the arm rest of the passenger door, where X was sitting.
Cops say one of the officers recognized DMX during the arrest and knew there was an active warrant for his arrest.
The officers proceeded to search the car ... and found 3 more bags of weed under the driver's floor board. ... so they cited the driver for possession of weed.
According to the report, DMX became "very aggressive with his words and was making multiple idle threats."
X was ultimately cited for weed and hauled to a nearby jail to deal with the warrant.
DMX was arrested in South Carolina last night -- but immediately called BS on the cops -- screaming out allegations that he was set up ... and it was all caught on tape.
According to DMX, the cops pulled over a car he was riding in for making an illegal U-turn. During the stop, cops say they found weed in the car and put the rapper in 'cuffs. Cops say they also noticed a warrant out for DMX stemming from a previous driving without a license case and informed him that he needed to go to jail.
X was pissed and began ranting about the situation while a female friend of his recorded the entire incident.
"This ain't no normal traffic stop," X screamed ... "18 cops, 5 cars, get the f**k outta here man."
X also claims the driver did nothing wrong -- and the car should never have been pulled over in the first place.
"It was legal ... they got nothing."
At one point, you can hear X say, "I'm sweatin' like a motherf**ker, yo."
X was eventually hauled to jail in Greer County, SC -- and he's scheduled to face a judge sometime this morning.
Law enforcement sources say ... X is expected to be sentenced to 15 days behind bars ... but will most likely only have to serve 10, if he's a good boy.
During the arrest, X suffered what is believed to be a slight asthma attack ... and paramedics responded to the scene to treat the rapper. Don't worry, he's fine now.