A small plane made an emergency landing on a New York beach Monday morning, flipping over when its landing gear reportedly became stuck in the sand.

The Cessna 172, with two teen students and an instructor aboard, began experiencing mechanical issues shortly after takeoff from Republic Airport, NBC New York reported. One of the junior pilots had been at the controls, but the instructor took over for the rough landing on Field 2 of Long Island's Robert Moses State Park beach. State Park Police said they were alerted to the incident around 9:30 a.m., according to Newsday.

Both students were taken to a hospital for evaluation, and the instructor remained at the scene to talk to investigators, NBCNewYork reported. No injuries were initially reported.