Twenty one people were taken to hospital and 12 were treated at the scene of the incident in Leith.
Thirty-three people have been injured after a ship tipped over at an Edinburgh dockyard.
The Scottish Ambulance Service said 21 people had been taken to hospital and 12 people were treated at the scene of the incident at Imperial Dock, Leith.
A major incident was declared after the research vessel Petrel became dislodged from its holding on a dry dock.
People have been asked not to attend A&E at Edinburgh Royal Infirmary (ERI) unless it is an emergency.
Pictures posted on social media show the 3,000-tonne vessel, which is owned by the US Navy, leaning at a 45-degree angle.
The Scottish Ambulance Service said it was called to the incident at 08:30.
A spokesperson said 15 patients were taken to Edinburgh Royal Infirmary, four to Western General Hospital and two to Victoria Hospital in Kirkcaldy.
Another 10 people were treated and discharged at the scene.
The service said it sent five ambulances, an air ambulance, three trauma teams, a special operations team, three paramedic response units and a patient transport vehicle to the scene.
The BBC understands that one person is in surgery in an operating theatre at ERI.
Jacquie Campbell, chief officer of acute services at NHS Lothian, said: “Given the expected pressure on the site, we urge people not to attend A&E at the Royal Infirmary of Edinburgh unless it’s an emergency.”
NHS Lothian has advised other people who require urgent care to contact their GP or call NHS 24.
Police Scotland urged the public to avoid the area to allow access for emergency services.
HM coastguard sent teams from Fisherrow, South Queensferry and Kinghorn to the scene as part of the multi-agency response.
The Scottish Fire and Rescue Service said it had sent four fire engines and “a number of specialist resources”.
The Health and Safety Executive said it was aware of the incident and was making inquiries.
The Sailors’ Society said it was supporting people affected by the incident.
“Our thoughts and prayers are with everyone affected by this morning’s accident in Leith. Sadly many are seriously injured. We are supporting those we can.”
Cammy Day, the leader of City of Edinburgh Council, said he was “deeply concerned” to hear of the incident.
“My thoughts are with all those affected and wish them a full and speedy recovery,” he said.
“Our teams are supporting emergency services in whatever way they can. Please avoid the area to allow the response to continue.”Leith councillor Adam McVey described the incident as “terrifying” for those on board.
He said on Twitter: “Emergency services are responding to a major incident at Leith docks – a ship has been dislodged from its holding in strong winds.
“My thoughts are with those who’ve been injured & hope everyone recovers quickly. Please avoid area.”
A spokesperson from Forth Ports said the incident happened at the facility of its tenant, Dales Marine Services.
They said: “We are providing Dales with any support we can today. We cannot comment any further as the incident response is being led by the emergency services.
“Our thoughts are with everyone involved in this incident.”
Dales Marine Services, which runs the dry dock, said it was liaising with the emergency services and could not comment any further.
A spokesperson said: “Our priority is to ensure those involved are supported.”
The 76m (250ft) ship has been owned by the United States Naval Facilities Engineering and Expeditionary Warfare Center since October 2022, and operated by Oceaneering International.
The vessel was previously owned by the estate of Microsoft co-founder Paul Allen. It was placed into long-term moorage in 2020 as a result of “operation challenges” during the Covid pandemic, and has not been used since.
Before this, it had been used for deep water searches for shipwrecks and war graves at sea, including the lost World War Two heavy cruiser USS Indianapolis, which was discovered 18,000 feet (5.5km) beneath the surface.