The director of the department of public safety or his or her designee wherein any officer commanded by any original writ or writ of mesne process to attach the real estate or right, title, and interest in the real estate of any defendant has attached the real estate or defendant's right, title, and interest therein, by himself or herself release and discharge the attachment upon the public records at any time after the attachment and before final judgment or decree:
(1) Upon being tendered a bond, running to the division of sheriffs, by the defendant or someone in his or her behalf with sufficient surety, which surety shall be a surety corporation authorized so to act in this state, in the penal sum of the amount of damages stated in the writ, with condition that the bond shall be null and void if there is a settlement or discontinuance of the action or cause, or if the final judgment or decree in the action or cause in which the writ of attachment was served shall be immediately paid and satisfied after the rendition of the final judgment or decree, or if the execution issued in the writ be returned satisfied, or if final judgment or decree in the action or cause is for the defendant, or upon the happening of any event which, ipso facto, would have resulted in the extinguishment of the lien of the attachment had the attachment not been released and discharged pursuant to the provisions of this section; or(2) Upon payment by a defendant, or by someone in his or her behalf, of the amount of damages stated in the writ, into the registry of the court in which the action or cause is then pending, and the clerk thereof shall immediately notify the sheriff of the fact of the payment and thereafter shall pay from the amount so deposited to the plaintiff, if final judgment or decree is in his or her favor, so much thereof as may be required to satisfy his or her execution, and shall pay the balance, if any, of the amount so deposited, with actual accrued interest, if any, to the defendant, and if judgment or decree in the action or cause is for defendant, in the event upon presentation of execution in his or her favor, the amount so deposited, with actual accrued interest, if any, shall be immediately paid to the defendant, but such amount may at any time be paid by the clerk as the parties may by their agreement stipulate, or as the court upon motion of any party in interest may direct.G.L. 1923, ch. 350 § 20; P.L. 1926, ch. 798, § 1; G.L. 1938, ch. 547, § 9; G.L. 1956, §10/5/2017; P.L. 1961, ch. 147, §1; P.L. 1997 , ch. 326, § 95; P.L. 2012 , ch. 324, § 23.