R. Kelly is feeling the heat in the wake of Lifetime’s docuseries, because while law enforcement hasn’t nailed him yet, he’s been suffering panic attacks severe enough to require medical attention.

Sources connected to the embattled singer tell us the panic attacks started in the days leading up to “Surviving R. Kelly” airing last week. The firestorm that erupted after it aired is affecting him, too, because we’re told they’ve continued … with one attack being so serious, he sought treatment at a hospital.

Our sources say, more often, he’s had doctors make house visits. We’re told the episodes are triggered by the overwhelming backlash Kelly’s getting from celebs and the general public. He’s shocked how the tables have turned … with most people now believing his accusers.

We’re told Kelly’s aware the pendulum isn’t swinging his way right now in the court of public opinion.

As for his birthday celebration Wednesday night … we’re told Kelly’s looking for reasons to get out of his house. Quite frankly, we’re told he still believes he’s done nothing wrong and doesn’t want to seem like he’s hiding.

His dwindling number of supporters — many of whom cheered him in the nightclub — might think he’s unfazed by the controversy. Truth is, the public outrage — even from Kelly’s own blood — is getting to him.