A fire department helicopter went down off Copacabana, the famous beach in the southern section of Rio de Janeiro, as its crew tried to rescue a swimmer who was struggling to make it ashore, but no one was seriously injured, Brazilian officials said.

The accident occurred around 4:10 p.m. Saturday near the luxurious Copacabana Palace Hotel and was caused by an undetermined mechanical failure, the Rio de Janeiro state fire department press office said.

The aircraft sank off Brazil's best-known beach and its four crewmen were taken to a hospital for treatement of minor injuries.

A surfer managed to rescue the swimmer after the helicopter crashed, the fire department said.

Initial reports said the low-flying helicopter had been swamped by a wave, but fire department officials denied that this occurred.

The helicopter will be refloated and moved to the beach, the Center for the Investigation and Prevention of Aviation Accidents said.

Hundreds of bathers at Copacabana gathered to watch the rescue of the firefighters.

Copacabana has been packed with visitors over the past few days due to a heat wave in Rio de Janeiro and the upcoming New Year's holiday.

Officials expect nearly 2 million people to gather on Copacabana beach on New Year's Eve to ring in 2013. EFE