More than 500 passengers and crew have been taken off a burning ship about a mile off Puerto Rico's north coast, with many requiring medical treatment, although there were no reported fatalities.

The fire continued to burn aboard the Caribbean Fantasy, a combination cruise and ferry ship, as US Coast Guard boats took passengers into San Juan's harbour while helicopters whirred overheard.

Other agencies and even private vessels joined in the effort before firefighters were ordered to abandon the ship.

"The boat's systems have collapsed. It's not safe any more to work inside the boat," said Angel Crespo, director of Puerto Rico's Emergency Management Agency.

The Coast Guard said all passengers and crew were evacuated. Federal authorities were interviewing the captain, Mr Crespo said.

The mostly Dominican passengers included dozens of school-age athletes headed to competitions in Puerto Rico, including a 22-member cycling team, a girls' volleyball team and a boys' baseball team. The ship runs several times weekly between Puerto Rico and the Dominican Republic.

The fire had apparently been burning for some time before the alarm was sounded.

Dominican passenger Maria Prensa said she was collecting her luggage when she smelled smoke. "I asked and they told me it was nothing, that it was under control," she said.

American Cruise Ferries operates the Panamanian-flagged ship built in 1989.

A ProPublica investigation found that the US Coast Guard had discovered 107 deficiencies during 61 inspections of the ship since 2010. The most recent inspections found no major faults, but a January 2015 inspection said oil fuel lines should be screened or protected in some way to avoid any spray or leakage on to ignition sources.

Mr Crespo said 105 people were treated at the scene, mostly for heat stroke, shock and dehydration, and 24 others had been taken to hospital, including three women who dislocated their ankles and a man who broke his leg going down the emergency slide.

On the docks, several dozen people were carried in on stretchers, one of which held a man hooked to an IV line who was cradling a newborn baby clad only in a nappy.

The injured were followed by a small group of children who held hands as they disembarked from Coast Guard boats.

Passengers found to be in good health were loaded on to city buses to be taken to the ship's original destination, where they went through customs.

The fire erupted in the engine room and was spreading to the rest of the ship, Miami-based Coast Guard spokeswoman Marilyn Fajardo said.