If upon the trial the verdict of the jury or, if the case be tried without a jury, the finding of the court be in favor of the plaintiff and against the defendant, judgment shall be entered for the restitution of the premises; and if the proceeding be for unlawful detainer after neglect or failure to perform any condition or covenant of a lease or agreement under which the property is held, or after default in the payment of rent, the judgment shall also declare the forfeiture of the lease, agreement, or tenancy. The jury, or the court, if the proceedings be tried without a jury, shall also assess the damages occasioned to the plaintiff by any forcible entry, or by any forcible or unlawful detainer, alleged in the complaint and proved on the trial, and, if the alleged unlawful detainer be after default in the payment of rent, find the amount of any rent due, and the judgment shall be rendered against the defendant guilty of the forcible entry, forcible detainer, or unlawful detainer for twice the amount of damages thus assessed and of the rent, if any, found due. When the proceeding is for an unlawful detainer after default in the payment of rent, and the lease or agreement under which the rent is payable has not by its terms expired, execution upon the judgment shall not be issued until the expiration of five days after the entry of the judgment, within which time the tenant or any subtenant, or any mortgagee of the term, or other party interested in its continuance, may pay into court for the landlord the amount of the judgment and costs, and thereupon the judgment shall be satisfied and the tenant restored to his or her estate; but if payment, as herein provided, be not made within five days the judgment may be enforced for its full amount and for the possession of the premises. In all other cases the judgment may be enforced immediately. If writ of restitution shall have been executed prior to judgment no further writ or execution for the premises shall be required.