Updated Sunday, April 24, 2016 1:31 p.m.

NEW YORK (CBSNewYork) — Police said an autistic teen walked out of a Saturday program at P.S. 721 in Coney Island and went to the beach.

READ MORE: David Gilbert, Man Convicted In Deadly 1981 Bank Heist In Rockland County, Granted Parole

Authorities got 911 calls from the school and later at the beach, where police said the nonverbal 14-year-old was going in and out of the water with no clothes on.

“It was a very dangerous situation,” Sgt. Christopher Vincenti told 1010 WINS’ Holli Haerr, noting there were rocky ocean conditions.

He tried to call to the teen to get him to come out, but when that didn’t work he and other officers went into the water themselves and rescued him to safety.

READ MORE: What's Causing Record Flooding? Experts Say Missing, Dying Trees Are One Reason

“We didn’t know if he could swim or anything like that. It could have been bad, but luckily luck was on our side and we were in the right place at the right time,” he said.

The teen left the school through a door that had an alarm on it, police said.

The teen was taken to the hospital for evaluation.

MORE NEWS: Candidate Conversations: Eric Adams

Toya Holness, a spokeswoman for the city Department of Education, told CBS2 in an email: “‎Yesterday’s event was hosted by a community based organization and was not a DOE program. This is a deeply alarming incident. Nothing is more important than the safety of all students and staff. We are working closely with the organization that hosted the event and the NYPD to investigate this incident. We train CBO providers on DOE Emergency Protocols‎ and will continue to provide ongoing support.”