Updated

Beachgoers sprang into action Monday after a 12-year-old boy was swept out to sea in New Zealand.

Josh McQuiod was playing with a friend near the water's edge when he was swept out to sea and dragged down by heavy surf, TVNZ reports.

"I thought I was going to die," McQuiod told ONE News. "The waves smashed me so much, there were five really big ones. They flipped me around quite a few times. I was underwater."

A police officer on the scene tried to pull McQuiod out of the water, but was unsuccessful.

Finally, several passers-by formed a human chain to anchor the police officer to the shore, and McQuiod was pulled to safety, TVNZ reports.

McQuiod was taken to a nearby hospital but has since been discharged. He expressed his gratitude to his rescuers.

"I'd love to thank them so much for what they did," McQuiod said. "They saved my life. If it wasn't for them, I'd be dead."

Click for more from TVNZ.