delivered the opinion of the court.
José J. Hernández, Pedro Delgado and E. Morales & Co. signed a joint promissory note for $700 payable to the Banco Territorial y Agrícola on February 4, 1918. In September of that year José J. Hernández sued Pedro Delgado for the amount of the note, alleging that at the request of the de fendant he signed the said promissory note as an indorser; that Delgado disposed of its amount and did not pay the note at its maturity; that the payee bank brought an action against the three signers of the note to recover the principal, interest, costs, expenses and attorney’s fees; that property of the plaintiff was attached, and that E. Morales & Co. have absolutely no property.
Judgment having been rendered against the defendant for the sum of $861.54 and the costs, he took the present appeal and alleges 'as its first ground that the trial court *542erred in overruling Ms- demurrer that the complaint did not set up facts sufficient to constitute a cause of action.
The contention of the appellant is that if the plaintiff is a surety, as he averred in the complaint, he must allege that he paid the obligation in order to have a right to be indemnified by his principal, according to sections 1739 and 1740 of the Civil Code; but the appellee alleges that even without having paid the note he has a cause of action against his principal under section 1744 of the Code, because the obligation had matured and because he had been sued for payment by the payee.
In accordance with sections 1739 and 1740, payment by the surety subrogates him to all of the rights which the creditor had against the debtor and gives him a right of ac tion to be indemnified by the latter; therefore, the complaint in this case does not allege facts sufficient to constitute a cause of action, because the surety did not allege that he had paid the note for his principal, and the fact that the obligation had matured and the surety had been sued for its payment does not give him a right of action to recover, inasmuch as the cases referred to by the appellee, which are those mentioned in section 1744, do not give the surety a right of action to recover the amount, but only to obtain from the debtor his release from the security or a guaranty to defend him against any proceedings of the creditor and from the danger of insolvency of the debtor, as expressly provided in the last subdivision of the said section. However, we shalL not reverse the judgment of the lower court for that reason, because the defendant admitted voluntarily at the trial in a stipulation made with the plaintiff and presented to the Court that the plaintiff paid the Banco Territorial y Agrf cola the amount of the promissory note, thus malting ap plicable the maxim, consensus tollit error em.
The second assignment of error is that the appellant was adjudged to pay the whole of the debt.
*543There is no question in this action of the legal relationship between the plaintiff and the creditor, bnt of that which arose between the plaintiff and defendant Pedro Delgado by reason of the facts stated; and in view of the fact that the plaintiff signed a joint obligation in favor of the creditor without receiving any benefit and only to accommodate Pedro Delgado, it follows that there existed between them the relationship of surety and principal, because Her-nández trusted Delgado to pay the said obligation and believed that in case he should have to pay it himself Delgado would reimburse him. Section 1728 of the Civil Code, which the appellant cites to show that the plaintiff was not his surety, and according to which security must be express and is not presumed, is not applicable to this case, for it was enacted for the protection of persons sued as sureties.
For the foregoing reasons the judgment appealed from must be
Affirmed.
Chief Justice Del Toro and Justices Wolf, Hutchison and Franco Soto concurred.