For five years, a New York City man managed to live rent-free in a landmark Manhattan hotel by exploiting an obscure local housing law.

But prosecutors this week said Mickey Barreto went too far when he filed paperwork claiming ownership of the entire New Yorker Hotel building — and tried to charge another tenant rent.

On Wednesday, he was arrested and charged with filing false property records. But Barreto, 48, says he was surprised when police showed up at his boyfriend’s apartment with guns and bullet-proof shields. As far as he is concerned, it should be a civil case, not a criminal one.