
    Gordon R. STAHN, Plaintiff and Appellant, v. The FAIRMONT NATIONAL BANK, A Bank Corporation in the State of Minnesota, Defendant and Appellee.
    No. 13759.
    Supreme Court of South Dakota.
    Considered on Briefs March 21, 1984.
    Decided May 15, 1985.
    Rehearing Denied June 21, 1985.
    
      Todd D. Boyd of Gunderson, Evenson & Boyd, Clear Lake, for plaintiff and appellant.
    Thomas J. Johnson of Quaintance, Swanson & Johnson, Sioux Falls, for defendant and appellee.
   WUEST, Acting Justice

(on reassignment).

This is an appeal from an order dismissing a declaratory judgment action. We affirm.

Appellant Gordon R. Stahn (Stahn), at all times here involved, was a resident of the state of Minnesota, and appellee Fairmont National Bank (Bank) is a national banking corporation incorporated in Minnesota with its principal place of business being located in Fairmont, Minnesota. In Minnesota, Stahn borrowed money from Bank. He executed two promissory notes secured by two mortgages upon three tracts of farm land located in Roberts County, South Dakota. Payments on the notes were to be made at Bank’s office in Fairmont. Stahn defaulted on the notes and Bank commenced foreclosure proceedings by advertisement in Roberts County. Pursuant to the foreclosure proceeding, a sheriffs sale was held on March 6,1981, and there being no other purchasers for the farm land, Bank purchased the same. On May 18, 1981, Bank commenced an action in South Dakota for a deficiency judgment. Stahn answered and filed a counterclaim against Bank and a third party. Additional pleadings and motions were filed. On March 4, 1982, the court entered an order dismissing Bank’s complaint for a deficiency judgment and Stahn’s counterclaim. No appeal was taken from this order of dismissal.

On February 8, 1982, Stahn commenced a declaratory judgment action against Bank alleging it was a national banking corporation in Minnesota, that it never was registered in South Dakota as a foreign corporation, and never received a certificate authorizing it to engage in business in South Dakota. Therefore, it could not purchase the land at the foreclosure sale. Stahn further alleged that the purchase was a violation of SDCL ch. 47-9A, commonly called the Family Farm Act, prohibiting certain corporations from owning or acquiring farm land.

Other allegations were made regarding the legality of the then pending deficiency action, which are now moot since its dismissal. Bank made a motion to dismiss Stahn’s present complaint alleging several reasons. The motion was granted.

On appeal, Stahn urges nine legal issues which may be summarized as follows: (1) whether Bank violated SDCL ch. 47-9A and (2) whether Bank did business illegally in South Dakota by purchasing the land at the foreclosure sale since it was not registered as a foreign corporation and authorized pursuant to SDCL 51-17-19.

The Family Farm Act, SDCL ch. 47-9A, provides that no corporation shall engage in farming nor own or acquire any title to real estate used for farming, or capable of being used for farming. Exemptions to the Act which bear some relevancy to this proceeding are: (1) any national or state chartered bank, or trust company, authorized to do business in this state; (2) a bona fide encumbrance taken for purpose of security; and (3) lands acquired by process of law in the collection of debts, or by any procedure for the enforcement of a lien or claim thereon, whether created by mortgage or otherwise with a proviso the lands must be disposed of in ten years.

Stahn claims Bank should have been authorized to do business under the provisions of SDCL 47-8-1 and SDCL 51-17-19, and since it was not, it is not exempt from the Family Farm Act. The Act does exempt any bank authorized to do business in this state under certain circumstances. There are additional exemptions, however. Bank took the mortgages as a bona fide encumbrance for purposes of security, which is a separate exemption to the Act. When they foreclosed and bought the property, they engaged another exception which exempts for any procedure for the enforcement of a lien or claim thereon, whether created by mortgage or otherwise, provided the land be disposed of in ten years. It is our opinion that Bank was exempt from the Family Farm Act when they foreclosed the mortgage and purchased the property at the foreclosure sale.

Stahn claims Bank failed to comply with SDCL 51-17-19, which requires a certificate of authority from the Director of Banking and Finance before transacting any business. Clearly, this statute has no application whatsoever to Bank. This statute applies to the organization of a state bank under the provisions of SDCL ch. 51-17 and the certificate is a requirement in the process of organizing and capitalizing a state bank under South Dakota laws before it can do business. Bank is already organized as a national bank and is not seeking to be organized as a state bank in South Dakota.

Stahn urges that Bank was a foreign corporation and had no right to do or engage in any business in this state without procuring a certificate of authority under the provisions of SDCL ch. 47-8, regulating foreign corporations. In the case at bar, Stahn, a Minnesota resident, executed the notes in Minnesota, which were payable in Minnesota. In First Federal Sav. and Loan, Etc. v. Lovett, 318 N.W.2d 133, 135 (S.D.1982), we said:

This Court has held, however, that a note and mortgage relating to an out-of-state business enterprise, but securing property within the state, can be sued upon by the foreign corporation which has not complied with the statutory provisions relating to foreign corporations. Charles Friend & Son v. Schmidt, 57 S.D. 477, 233 N.W. 913 (1930); see Thurston v. Cedric Sanders Company, 80 S.D. 426, 125 N.W.2d 496 (1963); General Motors Acceptance Corp. v. Huron Finance Corp., 63 S.D. 597, 262 N.W. 195 (1935). Thus, under the situation presented here, appellee’s failure to comply with SDCL 47-8-30 is not fatal to its foreclosure action. (Emphasis in original.)

By analogy, we adopt the same rule in this case. The foreclosure had to be brought in South Dakota because the security for the notes was land situated in South Dakota. Bank was not doing business in South Dakota when the loan was consummated in Minnesota. They had a right under First Federal, supra, to commence a foreclosure action, but chose foreclosure by advertisement. Under South Dakota law, Stahn could have forced them to abandon the foreclosure by advertisement and bring foreclosure by action. SDCL 21-48-9. He chose not to do so. Regardless of whether the foreclosure is completed by advertisement or action, the mortgagee may fairly and in good faith purchase the premises at the foreclosure sale. SDCL 21-48-13.

We hold Bank had a right under the circumstances to foreclose in South Dakota and purchase the land to protect its claim.

Other issues have been raised by Bank claiming that as a national bank they are not a foreign corporation, that federal laws preempt them, and maintaining Stahn’s position would be a violation of the commerce clause. Since we have decided the case on other grounds, we do not reach those issues.

We have carefully considered the other errors urged by Stahn and find no merit to them.

FOSHEIM, C.J., WOLLMAN and MORGAN, JJ., and ANDERST, Circuit Judge, concur.

ANDERST, Circuit Judge, sitting for HENDERSON, J., disqualified. 
      
      . SDCL 51-17-19 provides:
      The incorporators may call for the payment of subscriptions in full upon receipt of the notice that the articles of incorporation have been approved. The director shall issue a certificate of authority whenever it shall appear to him that the capital stock of such bank has been fully subscribed and paid in in money and such bank is lawfully entitled to commence business. No bank shall transact any business, except such as is incidental or necessarily preliminary to its organization, until such certificate of authority has been regularly issued by the director. Such certificate of authority shall be void if the bank named therein fails to commence business within one year from the date thereof.
     
      
      . SDCL 47-8-1 provides:
      No foreign corporation shall have the right to do or engage in any business in this state until it shall have procured a certificate of authority so to do from the secretary of state.
     