Hundreds of people were told to prepare to evacuate after a ferry caught fire off the coast of Puerto Rico.

There were 512 passengers and crew on board the America Cruise Ferries vessel when the blaze was believed to have broken out in the engine room.

The ship, Caribbean Fantasy, was a mile away from land after a 12-hour sailing from Santo Domingo in the Dominican Republic when the fire broke out.

The ferry later docked safely in Puerto Rico and there were no reports of injuries.

The US Coast Guard said that it responded to reports of a ferry fire about one mile from San Juan at 8.30 am local time.

Video shared on social media showed passengers wearing bright orange life jackets as they prepared to disembark as smoke emerged from the ship.

Coast Guard sent a mass-rescue craft to bring passengers safely to the San Juan harbor, according to local reports.