Exclusive

Offset will NOT be prosecuted by Georgia for gun possession -- the charges have been dropped, but they were only dropped so the feds could continue an even bigger investigation.

The Clayton County D.A.'s office tells TMZ ... prosecutors dismissed all charges on July 1 against the Migos rapper. However, according to docs, the D.A. decided to stand down at the request of the U.S. Attorney's Office. Turns out the feds are in the middle of an investigation ... and that's the only reason Offset was pulled over in the first place.

In docs, county prosecutors say the feds were concerned if they took Offset to trial for gun possession they'd have to tip their hand about information related to a larger investigation. Prosecutors aren't disclosing what that investigation is about, but say pursuing Offset's case "would alert other potential future parties to the investigation and evidence that may support federal charges against said parties."

TMZ broke the story ... Offset was slapped with a felony gun possession charge back in April. It had been the latest fallout stemming from his arrest last summer in Atlanta. He was also facing 2 separate charges -- possession of weed and making an illegal lane change, both misdemeanors.

In the docs, obtained by TMZ, prosecutors say ATF agents contacted officers in Clayton County, asking them to pull over Offset's vehicle, if there was probable cause, and identify all passengers.

Prosecutors say the probable cause was failing to maintain his lane and tinted windows. ATF merely wanted to know who was in the vehicle -- but when Clayton Co. officers smelled weed, they decided to search the car ... leading to Offset's arrest for gun possession.

As we told you first ... Offset's lawyer said he believes the rapper was targeted because he's rich, successful and black. Based on these new docs, though, Offset might have an even bigger problem ... with the federal government.