Three boys have died after getting into difficulty while swimming at a beach near Tarragona in northeastern Spain, officials said Sunday.

The incident happened on Friday at Arrabassada beach when a group of six boys jumped into the sea from rocks while a yellow warning flag was flying because of strong waves.

Three of the boys made it back to shore unaided, while the others were rescued by emergency crews.

A 12-year-old boy died at the scene despite efforts to resuscitate him, while two 13-year-olds were taken to hospital in a critical condition, regional emergency services said.

The two teenagers later died in hospital.