Two surfers from Brooklyn narrowly missed a shark attack in Cape Cod Monday.

A shark appeared and killed a seal not far from the shore in front of terrified beachgoers at Nauset Beach near Chatham, about two hours south of Boston.

The two surfers happened to be just feet away from the jaws of the shark. For a few minutes, people on the beach were in a panic, believing one of the men had been killed. In fact, it was the seal next to the surfer that the shark grabbed.

"I was just, like, pulling my board, and people were yelling, 'Get out the water, get out the water!'" said Nisi Schlanger of Manhattan Beach. "I thought I was dead."

"I just swam for my life right there, just dreading the moment the shark was gonna pull me in and suck me in," said Zevi Greenspan of Crown Heights.

None of the beachgoers was hurt. The beach, as well as other across the Cape, were closed to swimmers after several shark sightings Monday.

PHOTOS: New Yorkers Flock to Streets to Glimpse the Eclipse