A lifeguard participating in a training exercise at Smith Point beach on Fire Island was bitten by a shark Sunday morning, officials said.

Ten-year veteran with the county Zach Gallo was playing the role of a victim in the water around 10:15 a.m. when he was attacked by what he said was a roughly five-foot-long shark, suffering injuries to his chest and hand. Suffolk County Executive Steve Bellone said medics were able to respond quickly because crews were already on-guard, thanks to the training exercise.

"If you are going to have an encounter with a shark, this is probably the best scenario that you can have," Bellone said.

Gallo was able to walk out of the water after initially calling for help. He was taken to Southside Hospital for further treatment. Bellone said the victim was recovering well in the hours after the incident.

For the rest of Sunday, Bellone said he expected Smith Point beach to remain closed to swimming. The same was true for Cupsogue Beach County Park in Westhampton, where the county also prohibited swimming due to "dangerous marine activity."