Appellant filed its bill of complaint against appellees for tbe foreclosure of a mortgage on lands, executed by tbe latter to tbe former to secure a loan of money. Among other stipulations tbe mortgage contains tbe following: “Fifth. That if it shall become necessary to employ an attorney to foreclose this mortgage, or collect any part of tbe debt herein secured, they [tbe mortgagors ] will pay such reasonable attorney’s fees, and all other lawful and proper costs and expenses that may be incurred by tbe party of tbe second part in that behalf, and this mortgage shall stand as security for tbe same.” And in that part of tbe mortgage giving a power of sale to tbe mortgagee, the proceeds arising from tbe execution of tbe power are authorized to be applied — “first, to tbe payment of tbe expenses incurred in advertising and making tbe sale and to the payment of such reasonable attorney’s fees as may be incurred therein by tbe said party of tbe second part; and, second, to tbe payment of tbe principal,” &c.
Tbe bill charges that a foreclosure of tbe mortgage in tbe Chancery Court is necessary because tbe mortgage does not give to the mortgagee tbe right to purchase at a sale under tbe power, and that if complainant should so purchase, tbe sale would be liable to be vacated on the application of tbe mortgagors. As a further reason showing the necessity for a resort to a court of equity, it is averred that tbe mortgagors deny tbe validity of tbe mortgage, on tbe ground that complainant was a foreign corporation at tbe time tbe loan was made, and bad not complied with tbe law of this State requiring such corporations to have an authorized agent and a known place of business in tbe State; in consequence of which, it is averred, that no stranger, or third person would buy at a sale under the power, and that if sold under such a sale tbe property would bring much less than its value. It is also shown by the averments of tbe bill that tbe property is not of sufficient value to pay tbe mortgage debt, and that tbe mortgagors are insolvent, and it asks that tbe rents of *202tbe property may be intercepted and applied to tbe mortgage debt, and to that end that a receiver may be appointed.
Appellees, McCall and wife, demurred to tbe bill on numerous grounds, all of which, were overruled, except those directed specifically to that part of tbe bill which seeks to recover fees for complainant’s solicitors for services in the foreclosure proceedings under this bill, which last mentioned grounds of demurrer were sustained. Appellant, the mortgagee, brings the case here, and the only questioned assigned for error is the action of the Chancery Court in sustaining these special grounds of demurrer.
Independently of the contract of the parties, the Chancery Court has no power to allow fees to the mortgagee’s attorney for services in collecting the mortgage debt, or conducting the foreclosure proceedings, but, unless restrained by statute, as is the case in some States, parties who are competent to enter into mortgage contracts may stipulate therein for reasonable attorney’s fees for such services. Such stipulations are not opposed to public policy, as insisted by ap-pellee’s counsel, and may be enforced as part of the obligation secured by the mortgage. — Bynum v. Frederick, 81 Ala. 489.
Stipulations of this character usually assume one. of two forms: first, Where the right in the mortgagee to claim such counsel fees is referrable alone to the power, of sale in the mortgage, and is dependent upon a sale made pursuant to the power. Such was the character of the right in the following cases : Bynum v. Frederick, 81 Ala. 489 ; Sage v. Riggs, 12 Mich. 318; Hardwick v. Bassett, 29 Mich. 17. Second, Where the right to claim such fees may be exercised either upon a foreclosure under the power of sale in the mortgage, or by proceedings in a court of chancery. Such are several of the cases cited in 2 Jones on Mortgages, section 606; and also in the following cases : Tompkins v. Drenman, 95 Ala. 463; Lehman, Durr & Co. v. Comer, 89 Ala. 579.
Another class of such cases is met with in this State where the right to claim such fees in proceedings to foreclose the.mortgage in chancery is made to depend upon the existence of a necessity for resorting to that mode of foreclosure. Such was the case of Bedell v. New Eng. Mort. Security Co., 91 Ala. 327. Whether a case falls within the one class or the other depends upon the phraseology employed in the note or mortgage in each particular case. No general rule for the classification of such cases can be laid down by the court, but the intent of the parties must be deduced from the language of the entire contract.
*203In tlie case before us tlie mortgage contains two distinct stipulations touching the payment of counsel fees, viz., the fifth paragraph, hereinabove quoted, and in that part of tlie power of sale also quoted hereinabove. These two distinct stipulations are referrable, respectively, to the two modes of foreclosure, to-wit: by proceedings in chancery, and under the power of sale contained in tlie mortgage. This is the construction placed by this court on a similar mortgage in the case of Bedell v. New Eng. Mort. Security Co. 91 Ala. 325. It is to be observed in this case (and so it was in the case last cited) that the right to employ and pay an attorney from the proceeds of a foreclosure sale is made by the language of the agreement to depend on the existence of a necessity for such employment. This is clearly so as to a foreclosure by chancery proceedings,- and inferrentially so, as well as in the nature of the case, as to a foreclosure under the power. In the case, however, of a sale under the power in tlie mortgage, default in the payment of the mortgage debt, alone, may give rise to the necessity for such employment, the fee to be confined and proportioned to the services incident to the foreclosure under that power. But, in order to justify the claim to counsel fees in a proceeding to foreclose in chancery a mortgage containing a stipulation similar to that in the fifth paragraph of this mortgage, it requires something more than the mere default of the mortgagor in the payment of the debt to create a necessity for a resort to that expensive mode of foreclosure. It must be made to appear that foreclosure by sale under the power would be hampered or clouded by acts of the mortgagor or third parties, or for other good reason would not be as effectual to secure payment of the mortgage debt as would a foreclosure by suit. In Bedell’s case, cited above, it is said: “We can imagine many states of attendant facts which would render a chancery foreclosure necessary. Possibly, the case may be put in chancery by the mortgagors, or by some adversary claimant, which, per se, would demonstrate the necessity for an attorney ; and in such event, it would seem, the necessity for an attorney throughout the entire litigation would be self-evident. Possibly, the apparent necessity of allowing the mortgagee to bid and purchase, in order to realize the full value of the property, or, possibly, some obstacle which requires equitable interposition to remove it, or, possibly, conflicting equities, may furnish the requisite necessity'-.”
The bill in this case, as amended, shows that the property is inadequate in value to pay the entire mortgage debt, that the mortgagors are both insolvent, and that the mortgage *204confers no right on the mortgagee to bid and purchase at a sale of the property under the power ; this last fact, without the attendant facts above stated, was suggested in the above quotation from Bedell’s case as a contingency which might give rise to the necessity of a resort to chancery proceedings by the mortgagee; but, without holding it sufficient for that purpose, and leaving the question open as was done in the case quoted from, we consider it, and the accompanying facts above stated, in connection with the following, which, also appear from the bill, to-wit: that it is denied by the mortgagors that the mortgagee (a foreign corporation), at the time the loan was made, had complied with the laws of this State requiring it to have a duly authorized agent and known place of business in this State, and that in consequence of such denial of the validity of the mortgage by the mortgagors no stranger to the mortgage would purchase the property at a sale under the power, or if so, would not bid therefor “anything like the fair value of the property;” and, furthermore, it is made to appear that it is necessary to intercept the rents and have them applied to the mortgage ' debt. As an independent fact, this last might not be entitled to much weight in its hearing on this question, in view of the mortgagee’s right to secure such rents by taking-possession of the property under its mortgage, but we deem it proper to be considered in connection with all the other facts set forth in the bill having relation to this subject, because it may be fairly inferred from the statements of the bill that any attempt on appellant’s part so to take possession would he resisted by the mortgagors. In other words, the case made by the bill is this: The mortgagee must look to the property and rents, alone, for the payment of the mortgage debt, the mortgagors being insolvent. The mortgagors have by their own conduct put it out of the power of the mortgagee to make an advantageous or effective sale of the property under the power of sale, except by becoming the purchaser itself, and that, it can only do subject to a disaffirmance of the sale by the mortgagors.
Any different vieAv of the case would be to permit the mortgagors, themselves, to create the necessity lor a foreclosure in the Chancery Court, and there to object to the payment of counsel fees because the forclosure is in chancery. This would violate clear principles of equity as well as the terms of their own contract.
The rulings of the Chancery Court on the several grounds of demurrer, filed by the appellees, which are assigned as error in this court, are not in accordance with the principles *205herein declared, and its decree is therefore reversed, and the canse remanded.
Beversed and remanded.