
    IN THE MATTER OF THE FORECLOSURE OF DEED OF TRUST EXECUTED AND GIVEN BY PAUL W. HILL AND WIFE, PATRICIA B. HILL, GRANTORS, DATED THE 30TH DAY OF JANUARY, 1979, AS APPEARS OF RECORD IN BOOK 303 AT PAGE 470, ORANGE COUNTY REGISTRY, R. HAYES HOFLER, III, TRUSTEE v. PAUL W. HILL and wife, PATRICIA B. HILL; RAYMOND SUTTLES and wife, JOYCE SUTTLES; and R & H CONCRETE PUMPING, INC.
    No. 8115SC1080
    (Filed 6 July 1982)
    1. Mortgages and Deeds of Trust § 38— foreclosure proceeding — evidence of repurchase agreement — properly admitted
    In an action to foreclose on a deed of trust assigned to a company from a bank once the company paid the bank the balance due on the note, the trial court did not err in introducing evidence of a repurchase agreement signed by the company which had been required by the bank as a condition for the original loan since the agreement was evidence of a valid debt of which the company was the holder and was evidence that the petitioner had the right to foreclose under the deed of trust.
    2. Mortgages and Deeds of Trust § 28— foreclosure proceeding — assignment of bank’s rights to foreclose to surety for payment of note
    In a foreclosure proceeding where the parties had previously agreed that the bank would make a loan to R & H Company and take as security (1) a secured interest in the personal property, (2) deeds of trust on the respondents’ real estate, (3) guaranty agreements signed by the respondents and (4) a repurchase agreement from Allentown Co., and where the repurchase agreement provided that if Allentown purchased from the bank equipment for the amount then due on the note, the bank would assign its rights to Allentown, the trial court erred in failing to enforce the agreement and in concluding that the bank could not assign to Allentown, a co-surety with the respondents, any rights under the deed of trust against the other sureties. In none of the prior cases holding that sureties are not entitled to subrogation against co-sureties was there an agreement at the time the parties entered into the obligations that the party who paid a debt of the principal would have recourse against the other sureties, and G.S. 26-5 does not say that parties may not by contract agree to different rights than are provided by the statute.
    APPEAL by petitioner from Brewer, Judge. Order entered 6 February 1981 in Superior Court, ORANGE County. Heard in the Court of Appeals 26 May 1982.
    This matter began when the substitute trustee under a deed of trust petitioned to sell certain property in Orange County. A hearing was held before the clerk of superior court who entered an order allowing the substitute trustee to proceed with the sale. The respondents appealed and a hearing was held in superior court. The evidence at this hearing showed that in January 1979, R & H Concrete Pumping, Inc. was a corporation which was principally owned by Paul W. Hill and Raymond Suttles. R & H purchased from Allentown Pneumatic Gun Company certain equipment. In order to purchase the equipment, R & H borrowed $195,000.00 from First Union National Bank. The bank took a security interest in the purchased equipment, personal guaranties from Mr. and Mrs. Hill and Mr. and Mrs. Suttles, and deeds of trust on the residences of the Hills and the Suttles. Mr. and Mrs. Hill reside in Orange County and Mr. and Mrs. Suttles reside in Chatham County. The bank also required Allentown to sign a repurchase agreement which included the following provision:
    “Allentown Pneumatic Gun Company agrees that in the event that R & H Concrete defaults on their loan, Allentown will purchase the equipment from First Union National Bank for the balance of the unpaid principal on the loan. It is further agreed that Allentown will make the necessary arrangements to take physical possession of the equipment in the event of default. At that time, the Bank will assign all of its security interest and rights of recovery in the equipment to Allentown.”
    In June 1979 R & H defaulted on the loan and voluntarily delivered the equipment to the bank. The bank sold part of the equipment and delivered the rest to Allentown. After Allentown had sold the equipment delivered to it, Allentown paid the bank the balance due on the note. The bank assigned to Allentown all its interest in the note, deeds of trust, and guaranties. The respondents refused to pay Allentown and Allentown called on the substitute trustee to foreclose.
    The court made findings of fact in accordance with the evidence and concluded that immediately following the closing of the loan, Mr. and Mrs. Hill, Mr. and Mrs. Suttles, and Allentown were all jointly and severally liable for the payment of the note to the bank and were therefore co-sureties as to each other concerning their liability thereon. The court concluded further that the bank could not assign to Allentown, a co-surety with the respondents, any rights under the deed of trust against the other sureties. The court held that the substitute trustee is not authorized to proceed under the power of sale contained in the deed of trust.
    The petitioner appealed.
    
      Newsom, Graham, Hedrick, Murray, Bryson and Kennon, by Robert 0. Belo, for petitioner appellant.
    
    
      Dalton H. Loftin for respondent appellees Paul W. Hill and Patricia B. Hill.
    
    
      Barber, Holmes and McLaurin, by Edward S. Holmes, for respondent appellees Raymond Suttles, Joyce Suttles, and R & H Concrete Pumping, Inc.
    
   WEBB, Judge.

The petitioner’s first assignment of error is to the court’s receiving evidence of the repurchase agreement and considering it in reaching its decision. The petitioner, relying on In re Watts, 38 N.C. App. 90, 247 S.E. 2d 427 (1978), argues that the only matters that can be heard on a motion pursuant to G.S. 45-21.16(d) are whether there is (1) á valid debt of which the party seeking foreclosure is the holder, (2) default, (3) the right to foreclose under the instrument, and (4) whether notice has been given to those entitled to receive it. We believe the court properly considered evidence of the repurchase agreement. It was evidence as to two of the matters which are properly considered under Watts, that is whether there was a valid debt of which Allentown was the holder and whether the petitioner had the right to foreclose under the deed of trust. The petitioner’s first assignment of error is overruled.

We believe the petitioner’s second assignment of error has merit. The agreement between the parties as evidenced by several documents was that the bank would make a loan to R & H and take as security a secured interest in the personal property, deeds of .trust or the respondents’ real estate, guaranty agreements signed by the respondents and a repurchase agreement from Allentown. The repurchase agreement provided that if Allentown purchased from the bank the equipment for the amount then due on the note, the bank would assign its rights to Allentown. We know of no reason why this agreement should not be enforced. The respondents argue that the record shows and the court found that Allentown and the respondents were co-sureties and for this reason Allentown has no right of subrogation but is limited to contribution. We do not believe the fact that Allentown and the respondents may have been sureties for the payment of the note is determinative. In the cases cited by the respondents, Insurance Co. v. Gibbs, 260 N.C. 681, 133 S.E. 2d 669 (1963); Bunker v. Llewellyn, 221 N.C. 1, 18 S.E. 2d 717 (1942); and Liles v. Rogers, 113 N.C. 197, 18 S.E. 104 (1893), the court applied the principle that sureties are not entitled to subrogation against co-sureties. In none of these cases was there an agreement at the time the parties entered into the obligations that the party who paid a debt of the principal would have recourse against the other sureties. G.S. 26-5, upon which the respondents also rely, provides a surety who performs under a contract may maintain an action for contribution against other sureties. It does not say that parties may not by contract agree to different rights than are provided by the statute. See Commissioners v. Nichols, 131 N.C. 501, 42 S.E. 938 (1902), for a case which holds that a surety may contract for a different indemnity than he would be given by law in the absence of such an agreement. See also Bank v. Burch, 145 N.C. 317, 59 S.E. 71 (1907), for language to this effect.

We hold that the parties are bound by the contract they entered and this contract gives Allentown the right to foreclose under the deed of trust. We reverse and remand for'further proceedings pursuant to this opinion.

Reversed and remanded.

Judges CLARK and Whichard concur.  