Three men on a lunchtime surf off the coast of Dunedin are being heralded as heroes after a day trip to the beach went horribly wrong for a large group of Dunedin schoolgirls.

Thirty of 102 year 9 and 13 Columba College pupils at the beach on a day trip with the school were caught in a rip while swimming off Canoe Beach near Purakaunui, north of Dunedin, at 2pm yesterday.

The stronger of the girls got themselves out of trouble, but the rest had to be rescued by the three surfers, who made four trips to save about 16 girls.

Another two girls were saved by surf life-savers, who responded to the emergency call from where they were practising at nearby Warrington for the South Island IRB Championships, being held today.

By the time all of the girls were out of the water, emergency services had arrived at the relatively remote beach.

St John operations team manager Doug Third said ambulance officers treated 12 of the girls for water inhalation and mild hypothermia.

Four were flown to Dunedin Hospital in the Otago Regional Rescue Helicopter and another three later needed treatment at hospital.

A hospital spokeswoman last night said six of the girls assessed in the emergency department had been discharged, but one remained for further observation.

Mr Third, who attended the incident, said the scene at the beach was chaotic.''

Everyone was upset and it was difficult to tell who were patients and who weren't.''

Members of group were visibly upset and reluctant to speak to the Otago Daily Times, but as the rescue helicopter departed teacher Joanne Weggery stopped to thank the three surfers, Tom Leckie, from Port Chalmers, Dillon Ryan, of Dunedin, and Tony Denley, of Osborne.''

Everything is for a reason. Bless you. Thank you so much.''

Police, firefighters and ambulance staff also praised the actions of the surfers, who they said probably prevented a tragedy.

Port Chalmers firefighter Ant O'Neill, who was with the first fire crew to arrive at the beach, said the girls were very lucky the surfers were there.''

Those guys were definitely the heroes of the hour. They deserve some recognition.''

Mr Third said the girls were also ''blinkin' lucky'' the surf life-savers were in the area.

And it really was a matter of luck, Mr Leckie said.

The three men were working on a building site in the area and had decided on Canoe Beach only after a debate about which of the many breaks they would surf in their lunch break.

When they arrived there were pupils ''swimming in the shallows'' and the surfing was good, but after catching their fifth wave the surfers heard yelling.

About 100m from shore, there were 30 pupils out in deep water, sucked out by a ''severe'' rip.

The pupils were yelling and waving their arms and appeared to be panicking.''

They were going around and around and around and around,'' Mr Leckie said.

The men paddled out and rescued four girls at a time, pulling them from the deep water and taking them to a large inflated tyre tube that was floating further towards the shore.

The men made four trips to the girls and each time the tube was full the men swam the tube to shore as the exhausted girls hung on.

About six of the pupils caught in the rip were strong swimmers and aided the others until the men returned. The beach was deceptive because it had a gradual incline and then rapidly dropped off to deep water, Mr Leckie said.

''They were lucky. Without help, there would have been a few fatalities.''

''Definitely,'' Mr Denley said.

As the men left the beach to return to work from their dramatic lunch break, the pupils returned to school in the three buses that had brought them. Many were covered in blankets, and some struggled to walk.

One of the pupils told the ODT it was supposed to be a day to get to know one another, and, in a way, it had brought them together.

She would always remember a pupil throwing up blood on the beach and the bravery of the surfers, she said.

''Thank you. You saved so many girls' lives. We will be eternally grateful.''