§ 31326. Court sales to enforce preferred mortgage liens and maritime liens and priority of claims
(a)
When a vessel is sold by order of a district court in a civil action in rem brought to enforce a preferred mortgage lien or a maritime lien, any claim in the vessel existing on the date of sale is terminated, including a possessory common law lien of which a person is deprived under section
31325
(e)(2) of this title, and the vessel is sold free of all those claims.
(b)
Each of the claims terminated under subsection (a) of this section attaches, in the same amount and in accordance with their priorities to the proceeds of the sale, except that—
(1)
the preferred mortgage lien, including a preferred mortgage lien on a foreign vessel whose mortgage has been guaranteed under chapter
537 of this title, has priority over all claims against the vessel (except for expenses and fees allowed by the court, costs imposed by the court, and preferred maritime liens); and
(2)
for a foreign vessel whose mortgage has not been guaranteed under chapter
537 of this title, the preferred mortgage lien is subordinate to a maritime lien for necessaries provided in the United States.