Whenever the state is interested in the proceeds of any execution sale or any judicial sale, to any extent whatsoever, the state, acting through its attorney general and reporter, may bid on and buy in property either real or personal, at that sale, to the same extent as any natural person might do. Any sums due and payable on behalf of the state, as costs of sale or as a part of the purchase price of the property so bid in and paid by the state, shall be paid out of the general fund of the state treasury upon the warrant of the governor.