Police are investigating a Virginia man’s claim that he is a federal informant after he was caught with a loaded gun in his waistband at a Midtown hotel, law enforcement sources told the Post.

Ahmed Bakr, 27, was stopped around 10:45 p.m. Friday at the Renaissance Hotel on East 57th Street after security went to his room to check on an unrelated report of a break-in and discovered the loaded 9mm Glock, police said.

When police showed up, Bakr claimed to be an FBI informant and handed over the names and contact information for people who could verify his story.

Police have been unable to confirm his claims, which appear to be false, the source said.

Bakr was arrested and charged with criminal possession of a weapon.

The FBI did not immediately respond to a request for comment.