R. Kelly[1] believes Michael Jackson[2]'s attorney is just the guy he needs to help set him free -- but if that happens, it's gonna come at a steep cost.

TMZ broke the story ... Kelly met with[3] famed lawyer Tom Mesereau[4] -- who beat the rap for Michael Jackson back in 2005. We're told after the 4-hour meeting, Kelly was in hook, line and sinker. We're told Mesereau hasn't agreed to rep Kelly -- at least not yet -- but it could very well happen.

Here's the rub. Mesereau is one of the best and most sought after criminal defense lawyers in the country. He's turned prosecutors flat-footed in trials where it seemed open-and-shut against his client. Did we mention he scored a not guilty verdict for accused wife murderer Robert Blake[5]?

That said, Tom doesn't come cheap, and money has become super tight in Kelly's world. He's already hired a battery of lawyers, and he's making next to nothing[6].

We're told Kelly and his team are trying to figure out ways to raise the money to hire Mesereau.

As for why the singer wants to 86 his current attorney, Steve Greenberg, and his team -- our sources say R. Kelly believes they care way too much about getting media attention for themselves ... Greenberg calls the whole thing, "A complete load of crap."

R. Kelly's financial woes have been well documented -- he needed outside help to pay his initial $100k bond, and spent additional time behind bars[7] because he couldn't

Read more from our friends at TMZ