delivered the opinion of the court.
*378_
V. H. McGhee, the appellee in this case, sold and conveyed his interest in a lot in Florence, Alabama, to J. W. Borst, who assumed the prior liens upon the property, and executed two notes to McGhee lor $1,750 each, payable respectively January 3, 1891, and January 3,1892, on account of the purchase price of his interest in the land. Borst subsequently sold and conveyed the land to the appellants, A. L. Ellett and L. B. Tatum, who with their wives executed a mortgage upon it to Borst, in w hich, after assuming a prior lien u pon the land, they entered into the following contract or covenant with Borst to-wit: “Also the assumpsit for payment of the note of J. W. Borst to "W. H. McGhee for the sum of $1,750, which note is due on January 3, 1891, and is in part payment of said lot No. 12, as appears from the deed of McGhee and wife to J. W. Borst, of record in the probate judge’s office for Lauderdale county, Alabama. Also the assumpsit for payment of the second note of the said J. W. Borst to W. H. McGhee, for the sum of $1,750, which sum is due on January 3, 1892, and is.for the part payment of lot No. 12, in the purchase of Borst from W. H. McGhee. Also by reason of the indebtedness of said parties of the first part to the party of the second part in the sum of $1,750, which indebtedness is evidenced by promissory note of said parties of the first part in the said sum of $1,750, due and payable in two years after the date of this mortgage, with interest at the rate of 8 per cent. Also interest to be paid at said rate of 8 per cent, per annum on all amounts heretofore assumed to be paid by the parties of the first part; and whereas the said parties of the first part are willing to, and desirous of, securing the full and complete performance of all their undertakings and agreements in reference to the payments assumed by them, and also to secure the payment of the said note for the sum of $1,750, due the party of the second part on the 3d day of January, 1892. But it is understood by all the parties to this mortgage, that, in assumiug the payment of the note of *379J. W. Borst to "W". H. McGhee, for the sum of §1,750. which note is due January 3, 1891, the said J. "W. Borst is to pay to the parties of the first part the sum of §890, which they shall apply in full discharge of this noce for §1,750, or in other words, the parties of the first part are assuming the whole note as an accommodation to the said J. W. Borst, the amount which they will justly owe on said note of $1,750, which is due January 3, 1891, is only the sum of $860, with 8 per cent, interest, and in the event the said J. W. Borst fails to pay to the parties of the first part this sum of $890, with 8 per cent, interest, then the said parties of the first part shall be and are hereby empowered to pay the balance on said note of $1,750 — to-wit: The sum of §890, and interest, and shall be credited with the full amount on the other note of $1,750, due January 3, 1892, to J. W. Borst.”
The mortgage was foreclosed in a suit in the State of Alabama, the land sold, but the proceeds were not sufficient to satisfy the prior lien upon the land.
Afterwards McGhee brought a suit in equity in the court of Law and Chancery for the city of Richmond, against Borst, and the appellants, Ellett and wife and Tatum and wife, to recover from the appellants the balance due on the note of Borst to McGhee for $1,750, due January 3, 1891. The appellants demurred to and answered the bill, and upon a hearing of the cause the court rendered a decree against them for the amount claimed by the appellee. From that decree this appeal was allowed.
The first assignment of error is that the trial court ought to have sustained their demurrer and dismissed the bill for want of jurisdiction.
The contention of the appellants upon this point is that, whilst a mortgagee may proceed either in the foreclosure suit or afterwards by an independent suit in the same jurisdiction against the mortgagor and his grantees who have assumed the mortgage debt, to compel them to pay the residue thereof, he *380cannot bring such suit in. a different jurisdiction, as was done in-this case.
This question was fully considered in the case of Tatum, &c. v. Ballard, argued w ith this case and decided to-day, in which the conclusion was reached that the mortgagee has the light to proceed in a jurisdiction other than that in which the foreclosure-proceedings were had, to enforce his rights against the mortgagor and his grantees who had assumed the mortgaged debt. The demurrer was therefore properly overruled.
The next assignment of error is that the covenant in the mortgage by which the appellants assumed the payment of the note sued on was made in consideration of $860, which they owed Borst on the purchase price of the land, and of $890 which Borst agreed to pay to them to aid in paying the note, which they had assumed for his'accommodation, and that Borst having failed to pay them that sum, they were only bound to make payment upon the note to the extent of the $860, and that, having done this, they cannot be required to pay anything more upon the note.
The only claim which the appellee has against them is through Borst. His right to compel payment of the mortgage debt, in whole or in part, against them does not rest upon any contract of the appellants with him, nor with Borst for his benefit. To the extent that they assumed payment of the note as part of the consideration of their purchase of the mortgaged premises, they became, as between themselves and Borst, the principals, and he became the surety. The appellee, being entitled upon equitable principles to the benefit of all collateral securities held by Borst, had the right to resort, by way of equitable subrogation, to the covenant of the appellants with Borst for the payment of the note, either in the foreclosure proceedings, or afterwards by an independent suit in equity. Tatum v. Ballard, supra, and cases cited. In doing this, however, he stands in his debtor’s shoes, and is substituted to the rights and remedies of his debtor and *381nothing more. Willard v. Worsham, 76 Va. 392, 402; Osborne v. Cabell, 77 Va. 462, 468; Keller v. Ashford, 133 U. S. 610; 2 Jones on Mortgages, sec. 755.
The appellee, therefore, can only recover from the appellants what Borst could have recovered from them if he had paid the note in question to the appellee, and had brought an action against the appellants to recover from them for a breach of their covenant. In such a case it is clear that he would only he entitled to the extent of the $860, tbe consideration furnished by him to them for their undertaking, and that as to the $890 he could make no recovery, because he had failed to pay them that sum, as he agreed to dc, and to that extent the consideration for their covenant to pay the note had failed.
It is contended by appellee’s counsel that the covenant of the appellants to pay the note was absolute and unconditional, and that the undertaking of Borst to furnish the $890 in money was a mere private undertaking between Borst and themselves, which cannot affect the rights of the appellee. This contention cannot be sustained. The agreement upon this subject must be considered as a whole, and that construction and effect given it which the parties intended, as gathered from all of its provisions. Even if the covenant of the appellants to pay the note had been absolute and unqualified in the mortgage, and the parties had entered into a contemporaneous agreement limiting and qualifying that covenant, the latter would control. Crowell v. St. Barnabas Hospital, 27 N. J. Eq. 655-6; Keller v. Ashford, 133 U. S. 610, 625-6; 1 Jones on Mortgages, sec. 764.
It is also claimed that although Borst failed to pay the $890 as he agreed to do, yet as the appellants were indebted to Borst upon a note executed to him for $1,750, they could have paid the whole of the note due appellee, and would have been entitled to a credit to tbe amount of $890 upon the note executed to Borst, and that, having paid this latter note to *382Borst; without retaining a sufficient sum to pay appellee in full, they did so in their own wrong, and are therefore liable to appellee for the residue of his note. It is true that the appellants had the right to do this, but it was a mere option, a privilege which they might exercise or not as they saw proper, and not a duty which they were bound to perform or render themselves liable to appellee.
They owed no duty to the appellee, except such as grew out of their covenant with Borst, and, as they have fully- kept that covenant except in so far as they were relieved from it by Burst’s failure to keep his contract with them, they cannot be compelled to pay the residue of the note sued on. Osborne v. Cabell, 77 Va. 462, 468; 1 Jones on Mortgages, sec. 764.
The decree of the Law and Equity Court must be reversed, and the bill dismissed as to the appellants.
Reversed.