The judgment of the court upon such findings, if in favor of the plaintiff for the recovery of the real property, and in favor of the defendant for the counterclaim, shall require such plaintiff to pay to the defendant the value of the improvements as determined by such findings, within sixty days from the rendition of such judgment less the amount of the damages, if any recovered, for withholding the land and for waste committed upon said land by the defendant; and until such payment, or tender and deposit in the office of the clerk of courts in which such action is pending, no execution or other process shall issue in such action to dispossess such defendant, his heirs, or assigns; and in default of such payment by the plaintiff, the defendant shall pay to the plaintiff the value of said land as determined by such findings, and the damages, if any recovered, for withholding the same and for waste committed upon said land by him.
SDCL 21-41-16