A judgment or decree in such action or suit shall have the same effect respecting the discharge of the property from the mortgage or other lien held by the United States as may be provided with respect to such matters by the local law of the place where the court is situated. However, an action to foreclose a mortgage or other lien, naming the United States as a party under this section, must seek judicial sale. A sale to satisfy a lien inferior to one of the United States shall be made subject to and without disturbing the lien of the United States, unless the United States consents that the property may be sold free of its lien and the proceeds divided as the parties may be entitled. Where a sale of real estate is made to satisfy a lien prior to that of the United States, the United States shall have one year from the date of sale within which to redeem, except that with respect to a lien arising under the internal revenue laws the period shall be 120 days or the period allowable for redemption under State law, whichever is longer, and in any case in which, under the provisions of section 505 of the Housing Act of 1950, as amended (
12 U.S.C. 1701k), and subsection (d) of
section 3720 of title 38 of the United States Code, the right to redeem does not arise, there shall be no right of redemption. In any case where the debt owing the United States is due, the United States may ask, by way of affirmative relief, for the foreclosure of its own lien and where property is sold to satisfy a first lien held by the United States, the United States may bid at the sale such sum, not exceeding the amount of its claim with expenses of sale, as may be directed by the head (or his delegate) of the department or agency of the United States which has charge of the administration of the laws in respect to which the claim of the United States arises. In any case where the United States is a bidder at the judicial sale, it may credit the amount determined to be due it against the amount it bids at such sales.