A Melbourne schoolteacher has died after suffering a heart attack when he and a group of students were swept out to sea at Bells Beach.

Teacher Paul Simpson was dragged from the water unconscious shortly before 4:30pm (AEDT) on Thursday. Paramedics worked for more than 30 minutes to revive the 40-year-old but were unable to save him.

It is believed that Mr Simpson, two other teachers, and students aged 15 and 16 from Shelford Girls Grammar school in Caulfield in Melbourne got into difficulties after being caught in a rip.

The students were all rescued and treated at the beach.

Shelford principal Polly Flanagan said Mr Simpson died trying to save the students.

"He was an outstanding educator who sacrificed his life to help save students," she said. "This selfless action was typical of Paul - always putting the students first."

Torquay police Sergeant Brian McKiterick says two operators from a local adventure company managed to get everyone back to shore but Mr Simpson was washed out to sea a second time.

"He was placed near shore where you could stand and when the operator went back to rescue a couple of the girls the rip must have taken him, his feet were taken from under him and he's been pushed out to sea," he said.

He says a couple of students were initially knocked into the water but all ended up caught in the rip.

"I think everyone was swimming for their life, hectic, trying to save each other," he said.

"Everyone's done everything possible to get everyone back."

Sergeant McKiterick says the group had decided to abandon the snorkelling after the swell and wind picked up and they were trying to get back to shore.

Ambulance Victoria spokesman John Mullen says while Mr Simpson's death was tragic, paramedics at the scene believe it could have been an even worse situation given that the group became caught up in the rip.

"As tragic as it was with one death it could have been so much worse with those numbers and the ones that were caught in the rip," he said.

"They all got into a bit of difficulty and some got taken out a bit further."

Paramedics treated some students for minor injuries, including one who had suffered an asthma attack and two others who swallowed some water.

They helped the distressed students, who were in shock, make their way back up the beach to a car park to be taken back to their camp at Torquay.

- ABC/AAP