BOSTON (AP) — The man bitten by a shark off Cape Cod in Massachusetts this month says he punched it in its gills to escape the attack.

William Lytton, of Scarsdale, New York, is recounting his ordeal Tuesday as he recovers in a Boston rehabilitation hospital.

The 61-year-old neurologist tells The Associated Press he was swimming in 8 to 10 feet (2.4 to 3 meters) of water when he was attacked Aug. 15.

He says the shark bit down on his left leg but he began punching its gills.

Lytton says he's grateful to be alive after six surgeries but still has weeks of treatment before he's fully healed.

He's been at Spaulding Rehabilitation Hospital since Sunday, when he was released from Tufts Medical Center in Boston.

The shark attack was the first in Massachusetts waters since 2012.