Officials recommended that part of the city be evacuated, but reported there were no injuries and no damage to the environment.
Wes Lail, Morehead City's police chief, told a local television station that the chemical involved was pentaerythritol tetranitrate, known as PETN, which can be used in detonators and grenades.
PETN was the material used by a Nigerian man in his botched Christmas Day attempt to blow up a Northwest airliner en route from Amsterdam to Detroit.
There were no immediate details on how the nine containers came to be accidentally punctured, but a local television reported it happened as the containers were being offloaded.
PETN is used as plastic explosive and also to treat heart conditions. By itself it is non-explosive, but can detonate easily if mixed with other materials.
The port, which lies just seven kilometres from the Atlantic Ocean, is one of the deepest on the US east coast, and according to its website is a major exporter of phosphates.