delivered the opinion of the court.
■ Being the assignee of a credit of $5,500 originally created in a deed of April 19, 1902, executed by Calixta Ruiz y Pérez, as mother with patria potestas over her then minor son Aurelio Quiñones Ruiz, in favor of Manuel León Parra and secured by a mortgage on a property of 141 acres- situated in the ward of Anón, municipality of Ponce, Pedro Nadal Sureda brought proceedings against the mortgagor in the District Court of Ponce to foreclose the said mortgage.and judgment'was entered in his favor. The said property was offered for sale at public auction, but no bid was made and it was conveyed to the mortgagee, Pedro Nadal Sureda, in payment of the debt by a deed of May 12, 1906, which was recorded in the registry of property.
The value of the property at the time was less than $5,500 and at present it is worth less than $3,000.
*457By virtue of successive conveyances the ownership of the said property passed to José Bestard Cañellas, Carlos López de Tord and Charles M. Boerman, the first taking a one-half interest and the others a one-fourth interest each by a public deed of September 18, 1914, executed in their favor by the previous owner, Tomás Sbert y Mezquiada.
Charles M. Boerman died and was succeeded by his sole and universal testamentary heirs, Mrs. Charles M. Boerman and Mrs. Esther Bessie Boerman, his widow and mother respectively, who together with José Bestard Cañellas and Carlos López de Tord are the plaintiffs in this action.
Pedro Juan Serrallés was the assignee of a second mortgage credit of $8,000 created on the same property by Calixta Ruiz Pérez in representation of her son, Aurelio Quiñones Ruiz, in a deed of April, 1902, also recorded in the registry of property, and in March, 1916, he brought a foreclosure proceeding under the Mortgage Law in which he obtained judgment and the property was conveyed to the said Pedro Juan Serrallés, the defendant in this action.
In that foreclosure proceeding Mrs. Esther Bessie Boer-man was not summoned personally, or by substitution or publication, nor did the complaint set up the necessary facts to determine the existence and maturity of the debt and the jurisdiction of the court.
Under these facts as related in synopsis the plaintiffs, the successors in interest of Pedro Nadal Sureda, brought an action against Pedro Juan Serrallés, who was in possession of the property conveyed to him in payment of the second mortgage, praying for judgment as follows: 1st. That the second mortgage assigned to defendant Pedro Juan Serrallés has become extinguished for lack of guaranty and should he canceled; 2nd. That the foreclosure proceeding prosecuted by Pedro Juan Serrallés for the recovery of the second mortgage credit assigned to him is null and void; 3rd. That the plaintiffs recover from defendant Serrallés the property in *458question, its mesne profits and the costs, expenses and disbursements, including attorney fees.
Defendant Pedro Juan Serrallés demurred to the complaint on the ground that it did not allege facts sufficient to constitute a good cause of action and the demurrer was sustained on December 22, 1917. The plaintiffs moved for judgment which was entered on January 30, 1918, dismissing the complaint for lack of facts sufficient to constitute a good cause of action, without costs.
From that judgment the plaintiffs appealed to this court.
The only question to be considered in this appeal is whether the complaint alleges facts sufficient to constitute a cause of action, a demurrer lying on this ground under subdivision 6 of section 105 of the Code of' Civil Procedure.
According to the allegations of the complaint, which must be taken as true in view of the demurrer, defendant Pedro Juan Serrallés collected a second mortgage in a foreclosure proceeding brought against the property which the plaintiffs had acquired by a title derived from a person to whom it had been conveyed in payment of a first mortgage.
Article 175 of the Eegulations for the Execution of the Mortgage Law, after prescribing that the only cases in which the foreclosure proceeding can be suspended are the existence of criminal proceedings charging forgery of the mortgage involved in the foreclosure, the filing of an action of intervention in ownership exhibiting a title of ownership recorded in favor of the intervenor under a date prior to the record of the credit of the foreclosing mortgagee, and the presentation of a certificate of the registrar to the effect that the mortgage involved in the foreclosure has been canceled, or an authentic copy of the instrument of cancelation of the mortgage, provides in subdivision 9 as follows:
“All other claims that may he brought, either by the debtor or by third persons in possession and other persons interested, including those involving the nullity of the title or of the proceedings, or the maturity, truth, extinction or amount of the debt, shall be *459heard in the proper plenary action, without -ever producing the effect of suspending or interfering with the execution proceedings.”
The plaintiffs in this case were third persons in possession of the property put up at auction and conveyed to this defendant, Pedro Juan Serrallés, in a foreclosure proceeding for the collection of a second mortgage, and under the statute transcribed the right was reserved to them to bring an ordinary action to annul that proceeding for any invalidating defect.
The allegations of the complaint show the invalidity of that proceeding.
Pedro Juan Serrallés, as a junior mortgagee, could in no manner collect the total amount of his credit, thus forestalling and leaving unpaid the preferred credit of Pedro Nadal Sureda.
Section 1828 of the Civil Code provides as follows:
“Credits which enjoy preference with regard to certain real property or property rights exclude all others for their amounts to the extent of the value of the real estate or property rights to which the preference refers.”
The Supreme Court of Spain, in its judgment of October 11, 1899, 88 J. G. 65-71, in a case where the question was whether by virtue of the complaint alone, without any other previous claim or formality, a third mortgage creditor could collect the total amount of his credit from those in possession of the mortgaged property as the successors of a creditor to whom it was conveyed extrajudicially by the debtor in payment of the first and second mortgage credits, established the following doctrine:
“Although it is true that the mortgage directly and immediately subjects the properties encumbered, whoever may be in possession, to the fulfilment of the obligation it guarantees, nevertheless where there are several mortgages on a property the order of preference thereof is determined, as specifically provided by law, according to the priority of the respective records in the registry; and in ac-*460cordanee witli this rule, the application of which is necessary where-ever several mortgage credits exist, the right of the plaintiff, the appellant here, is limited to recovering in the corresponding proceeding that part of the actual value of the property — not of the value reasonably or arbitrarily given thereto — that is left after paying the mortgage credits previously recorded.”
That doctrine is in conformity with the provisions of section 1828 of our Civil Code, equivalent to section 1927 of the Spanish Code, and was applied by this court in the case of Henna et al. v. Saurí & Subirá, 22 P. R. R. 776. For a greater reason it is applicable to this case in which the conveyance vas made in a court proceeding and not by an agreement between the debtor and the first mortg’agee made in a public deed, as in the case decided by the Spanish court.
Tlie foreclosure proceeding brought by Pedro Juan Serra-llos was not the proper proceeding for the recovery of what remained of the actual value of the property after the payment of the first mortgage credit.
It is true that the preferred credit of Pedro Nadal Sureda became extinguished upon the conveyance of the property whereby he became the owner of it, but that fact does not justify the conclusion that the property so conveyed was subject to the total payment of the second mortgage credit in absolute disregard of the rights of the first mortgagees and in violation of the provisions of the Civil Code and the Mortgage Law which give him the preference. If such were the case it would result, as said by the appellant, that the second mortgagee would collect the whole of his credit as if by magic while the first mortgagee would lose all of his rights and his entire credit. And no one is allowed to enrich himself at the expense of another.
Furthermore, Pedro Juan Sérrallés knew, for it so appeared from the registry, that the property conveyed to him in payment of a second mortgage credit had been previously conveyed to Pedro Nadal Sureda in payment of a preferred credit; therefore, in securing the conveyance to himself as *461lie did, without recognizing any right in the first mortgagee and leaving the latter’s credit unpaid, Serrallés knowingly violated the preference which the law gives to the first mortgagee over junior mortgagees.
It was unnecessary to allege in the complaint, as the ap-pellee maintains, that the second mortgagee had been made a party defendant in the proceeding in which the property was conveyed to Pedro Nadal Sureda, the senior mortgagee, because for the very reason that he was not so made a party it has been necessary to bring the ordinary action to obtain judgment for the cancelation of the second mortgage. If there had been such intervention the second mortgage could be canceled without bringing any action, pursuant to article 82 of the Mortgage Law. Peña v. Annoni, 7 P. R. R. 195.
According to article 79 of the Mortgage Law, the total cancelation of records and cautionary notices may be de-demanded and must be ordered, among other cases, when the recorded right is completely extinguished,, and under article 132 of the Mortgage Law Regulations a recorded property right shall be considered extinguished, among other cases, when the estate having been sold by order of the court and the first mortgagee having been paid, no balance remains to be applied to the payment of credits subsequently recorded, in accordance with the provisions of article 125 of the law.
Article 125 provides as follows:
* * In the case of one or several estates being encumbered by mortgage debts of various creditors, and they are sold or awarded for the payment of the first creditor in such manner that, the value of what is sold or awarded does not equal or exceed the mortgage debt which is liquidated, the remaining debts shall be, by act and right, considered canceled, and upon' presentation of the proper judicial order showing the sale or award and the reasons for same, there shall he canceled in the registry, including in the entry of cancelation the act constituting the liquidation of the preferred credit, all subsequent records of annuities (censos) or mortgages and records of attachment also made subsequently, thus leaving the *462estate or estates which have been conveyed or awarded free from all incumbrance. * * * ”
The statutes transcribed confirm our statement that the allegation to which the appellee refers is unnecessary.
For the purposes of the complaint it was sufficient to allege, as was alleged, that when the property was sold for the payment of the first mortgage its value was less than $5,500 and that at present it is worth less than $3,000. Our decision in the case of Montes de Oca v. Báez et al., 23 P. R. R. 656, does not favor the appellee’s contention, but, on the contrary, reveals the necessity of a declaratory action for the cancelation of a junior mortgage where the mortgagee has not been notified of the proceeding for the collection of a first mortgage.
The appeal is supported by the foregoing reasons and it will be unnecessary to examine other questions of law raised therein.
The judgment below must be reversed and the case remanded for further proceedings not inconsistent herewith.
Reversed.
Justices Wolf and Aldrey concurred. Justices del Toro and Hutchison concurred in the judgment.