In addition to the penalties prescribed in section
1908 of this title, a ship required by the MARPOL Protocol to have a certificate—
shall be detained by order of the Secretary at the port or terminal where the violation is discovered until, in the opinion of the Secretary, the ship can proceed to sea without presenting an unreasonable threat of harm to the marine environment. The detention order may authorize the ship to proceed to the nearest appropriate available shipyard rather than remaining at the place where the violation was discovered.