A plane crashed in the water off the Florida Keys Friday afternoon.

The small private plane went down in the shallow Gulf of Mexico water off the city of Marathon shortly before 5 p.m., the Monroe County Sheriff’s Office said in a statement.

The sheriff’s office released a photo of the plane resting upside down on the bottom of the Gulf.

U.S. Coast Guard Petty Officer Nicole Groll said two people were rescued from the water by a boater. They were not seriously injured, Groll said.

According to the Coast Guard, the pilot noticed a malfunction soon after takeoff from the Florida Keys/Marathon International Airport. To avoid crashing into a residential area, the pilot opted to try a water landing, Groll said.

The sheriff’s office said the Florida Fish and Wildlife Conservation Commission will investigate the crash.

The incident comes a day after a man was killed in a small plane crash off Pompano Beach.