284.25 LIEN FOR TAXES.
When, in any action or proceeding in court, the forfeiture to the state for taxes of any parcel of land which shall have been sold as provided by law is invalidated, except in the cases where such forfeiture is invalidated because the land was exempt from taxation or because all taxes were paid prior to forfeiture, the court shall determine, upon such hearing and evidence as it may require, the following facts:
(1) The amount of all taxes, special assessments, penalties, interest, and costs, if any, which were due against the land at the time of the supposed forfeiture;
(2) The amount of all subsequent taxes and special assessments that would have been assessed and levied against the land but for the supposed forfeiture;
(3) The amount of all taxes paid by the purchaser, or the heirs, representatives, or assigns of the purchaser, since the sale;
(4) The value of any improvements made on the land by the state before the sale;
(5) The value of any improvements made on the land by the purchaser, or the heirs, representatives, or assigns of the purchaser, after the sale;
(6) The net rental income received by the state, or its agencies, from the land prior to the sale thereof, after deducting all expenses of maintenance and repairs;
(7) The amount of the purchase price or portion thereof actually paid by the purchaser, or the heirs, representatives, or assigns of the purchaser.
Except as otherwise herein provided, the court shall thereupon adjudge and declare a lien in favor of the purchaser, or the heirs, representatives, or assigns of the purchaser, upon the land for the total amount of the foregoing items numbered (1) to (5), with interest on the respective items thereof from the time the same accrued or were paid by the purchaser, as the case may be, at four percent per annum, less the amount of item number (6).
In all cases where the sum of items numbered (1) to (5), with interest as aforesaid, less item (6), exceeds the total amount of items (3), (5), and (7), with interest as aforesaid, the court shall deduct the amount of the excess from the lien in favor of the purchaser and adjudge and declare a lien for such excess in favor of the state, which shall be deemed to be a party to the proceeding for that purpose.
The court shall adjudge that the land be sold by the sheriff to satisfy, first, the lien of the purchaser, or the heirs, representatives, or assigns of the purchaser, and, second, the lien of the state, if any, together with the costs of the judgment and sale, in the same manner and with like effect as in the case of sale of land on execution.
In case the amount of item (7), with interest as aforesaid, exceeds the total amount of items (1), (2), and (4), with interest as aforesaid, less item (6), the purchaser, or the heirs, representatives, or assigns of the purchaser, shall be entitled to refundment of the excess from the forfeited tax sale fund, payable by warrant of the county auditor upon order of the court.
When land shall be sold in any such proceeding to satisfy a lien adjudged in favor of the state, the sheriff shall pay the proceeds of such sale, after payment of prior liens adjudged in the proceeding, and costs, to the county auditor, who shall note upon the tax records the receipts of such sum and the purpose thereof, pursuant to the judgment of the court, and shall deposit the same with the county treasurer, to the credit of the forfeited tax sale fund.
At any sale of such land to satisfy a lien adjudged in favor of the state, the county auditor, with the approval of the county board, may bid in the land in the name of the state, paying the amount required out of the forfeited tax sale fund, and if the land be sold to the state and be not redeemed, it shall be held and disposed of as in case of lands forfeited for taxes.