'Real Housewives of Atlanta' star Peter Thomas is THIS close to getting sprung from a Florida jail ... following his arrest for allegedly writing a bad check in Louisiana.

TMZ broke the story ... Peter was busted Friday after getting off a plane at Miami Intl. Airport. The arrest stemmed from an outstanding warrant in Louisiana, where he was wanted for allegedly writing a $4k check that bounced.

But now, the St. John the Baptist Parish District Attorney's Office tells TMZ ... Peter's resolved the matter after his attorney paid the guy $4k. Because he squared away the debt, the D.A.'s Office will not move forward with the case.

We're told Peter is still in custody in Miami but the D.A.'s in the process of notifying the Sheriff's Office, and Peter will soon be set free. Peter's attorney, Keith A. Doley, tells TMZ, "This appears to have been a very big misunderstanding on several people's part and It was not a malicious intent on Mr. Thomas’ end."

Peter -- who infamously pulled a knife on Kenya Moore's ex, Matt Jordan, back in 2017 -- told us the allegations were false and he had no doubt he'll be acquitted from any wrongdoing.