Emergency services were called to the MPV Hirta, a fishery protection vessel docked near Ocean Terminal in Leith, after the man in his mid-30s inhaled a mixture of chemicals yesterday afternoon.
Ambulance crews, police, firefighters and coastguard workers were sent to the scene.
The man was helped from the ship by fire crews and taken to Edinburgh Royal Infirmary after he inhaled the chlorine in the engine room while he was mixing chemicals to clean sewage pipes.
The ship’s crew are investigating how a cap on a chemical drum was removed, causing substances to leak. Cordons were placed around the area as to allow an investigation and a clean-up to take place.
Emergency service workers wore bio-hazard suits as they dealt with the situation over a two-hour period.
Forth Ports said it was a “relatively minor incident” and no other ships had been affected.
A spokeswoman for the Scottish Fire and Rescue Service said: “We dealt with a chemical leak in the engine compartment. One male casualty in his mid-30s was suspected of inhaling a mixture of chemicals.
“After 5pm, the incident was handed over to the ship’s captain.”
In total, 24 firefighters, three pumping appliances and three special appliances were sent to the scene. A vehicle specially designed for chemical spills also attended.