A man who allegedly exposed himself to people on Miami Beach was taken into custody after he attempted to evade officers by jumping in the ocean and swimming away, police said.

Witnesses told police the man was "doing inappropriate things" and "exposed himself" to beachgoers. One witness said he watched the suspect bother several adults and even two children, which prompted him to call the authorities.

"That's when I called police, when I saw the first one. They took him off the beach and the next thing I know, I look over and he was running into the water with his pants coming down," Tyler Morin said. "He swam out and the helicopters and everyone was running after him."

Investigators say the man jumped into the ocean on 61st Street and swam the length of 11 blocks before he was apprehended near Ocean Drive and 72nd Street.

The man, whose name wasn't released, is facing several charges including loitering, prowling and battery on a law enforcement officer.