The police official did not know the man's name or nationality.
Local TV footage showed the man swimming around the moat as the police chased him with a long stick, attracting a crowd of onlookers. He was in the water for about an hour.
He eventually got out of the water and climbed a stone wall only to fall into the hands of police officers who were waiting for him. The police official said the man was detained for questioning, but could not confirm if he was arrested or charged.
Broadcasters were careful to meet Japan's obscenity laws once he had climbed out of the water, masking images of his private parts with a blurry dot.
The police official said he had never heard of a skinny-dipper causing a stir in the palace moat before.
"If you know what is within the moat, you won't go skinny-dipping there," he said, referring to Emperor Akihito, who lives in the palace. The moat is separated from the emperor's residence by high stone walls and woods.
A palace official said the emperor was in the palace, but it was unlikely he saw the nude swimmer. He also spoke on condition of anonymity in accordance with palace policy.