Engerud, J.
The defendant Robb-Lawrence Company is a public warehouseman, duly licensed as such under chapter 141, page 180, Laws 1901. The defendant Northern Trust Company is the surety on the former’s bond as such warehouseman. The Hart-Parr Company, which we shall hereafter refer to as plaintiff, is a foreign corporation, and has brought this action by leave of the attorney general, in the name of the state, to recover for an alleged breach of the warehouseman’s bond executed pursuant to the law mentioned by the two defendant corporations. The complaint, in substance, alleges that the plaintiff is entitled to the possession of certain personal property valued at $2,900, which it had previously delivered to the Robb-Lawrence Company as a public warehouseman; that said company had refused to deliver the property on demand, and had converted the same to its own use. The only defense involved on this appeal is the one whereby the defendants claim immunity from liability because the plaintiff is a foreign corporation. That plea is set forth in the amended answer as follows : “Denies that said Hart-Parr Company, if it be a foreign corporation, as alleged in paragraph 1 of said complaint, is entitled to maintain this action, for the reason that it has not complied with the conditions of chapter 22 of the Civil Code of this^státe, and par*58ticularly the provisions of section 3261 and 3263 of the Revised Codes of 1899, and defendant alleges that any contracts entered into by said Hart-Parr Company are therefore void. And in this behalf defendant alleges that said plaintiff had not, at the time of the issuing of the warehouse receipt described in the complaint, or at the time of the commencement of this action, filed in the office of the secretary of state of this state a copy of its articles of incorporation, duly authenticated, or otherwise; that plaintiff is not a corporation created for religious or charitable purposes solely; that plaintiff has not, bjr an instrument in writing, duly authenticated, or otherwise, filed in- the office of the secretary of state and his successors in office, its attorney, true and lawful, or otherwise, upon whom process in any action or proceeding against it may be served.” When the plaintiff attempted to prove the facts alleged in the complaint, the defendants objected to any evidence of such facts, unless the plaintiff first proved that it had complied with the provisons of sections 3261 and 3263, Rev. Codes 1899. The plaintiff asserted that it had never come within the terms of the statute by “doing business” in this state. The court, however, held that the transaction alleged in the complaint was of itself sufficient to constitute “doing business” in the state within the meaning of the statute, and that, although it was not necessary for the plaintiff to allege in the complaint that it had complied with the statute, yet it was incumbent on plaintiff to prove such compliance, because the plaintiff’s right to sue was put in issue by the answers. The objection was accordingly sustained, and as the plaintiff offered no evidence of its authority to do business in this state, a verdict was directed for defendant. This appeal is from the judgment entered on that verdict.
Section 3261, Rev. Codes 1899, provides: “No foreign corporation, association or joint stock company, except on insurance company, shall transact any.business within this state, or acquire, hold or dispose of any property, real or personal, within this state, until such corporation shall have filed in the office of the secretary of state a duly authenticated copy of its charter or articles of incorporation, and shall have complied with the provisions of this chapter; provided, that the provisions of this chapter shall not apply to corporations created for religious or charitable purposes solely.” In addition to the conditions imposed by the foregoing provisions, section 3263 requires such foreign corporations doing business in *59this state to file a power of attorney in the office of the secretary of state, constituting that officer and his successors its attorney upon whom process may be served with the same force and effect as if served personally upon the corporation in this state. Section 3265 declares that “every contract made by or on behalf of any corporation, association or joint stock company doing business in this state, without first having complied with the provisions * * * of sections 3261 and 3263, * * * shall be wholly void on behalf of such corporation, association or joint stock company and its assigns, but any contract so made in violation of the provisions of this section may be enforced against such corporation,” etc. Section 136 of our constitution prohibits any foreign corporation from doing business in this state “without having one or more places of. business and an authorized agent or agents in-the same upon whom process may be served.” In view of' this constitutional provision, it is clear that compliance only with the statutory provisions above referred to would be of no avail in this state, unless it also had one or more places of business within the state, as required by the constitution. The legislature could not waive a condition which the constitution imposed. The statute and the constitution must, therefore, be read together, and the former must be construed as supplementary to the latter. Both the statutory and constitutional prohibitions relate to the same class of foreign corporations, viz., those “doing business” in this state. The statute imposes additional conditions to those imposed by the constitution, and specifically declares what shall be the consequences of a violation of the statutory and constitutional prohibitions. These prohibitions apply only to those foreign corporations which do business in the state. What is meant by “doing business,” or “transacting business?” Respondents contend that these terms must be taken literally and construed to include every act done by a corporation of a business nature. In that broad sense the making of a single contract, a single act of buying or selling, and even the prosecution or defense of an action would be a business transaction which could not be done in this state by a foreign corporation unless it had previously established a place of business here and complied with the statutory conditions. If that were the meaning of the language used in the statute and constitution, it is apparent that in a large number of cases the enforcement of the law would interfere with interstate *60commerce. Mearshon v. Lumber Co., 187 Pa. 12, 40 Atl. 1019, 67 Am. St. Rep. 560; Milan Milling Co. v. Gorten, 93 Tenn. 590, 27 S. W. 971, 26 L. R. A. 135; Keating Impl. Co. v. Carriage Co. (Tex. Civ. App.) 35 S. W. 417; Cooper Mfg. Co. v. Ferguson, 113 U. S. 727, 5 Sup. Ct. 739, 28 L. Ed. 1137.
The fact that foreign corporations proposing to do business here are required to establish a place of business within the state makes it clear that the term “doing business” does not mean a single isolated transaction. It is not reasonable to suppose that the constitution or the statute intended that a foreign corporation, without intending a continuance of its business in the state, could not collect a debt or make an)' contract or demand that its property rights should be respected unless it had previously acquired a situs or domicile within our borders. The object of laws of this character is to require foreign corporations which undertake to carry on their business generally in this state, to establish a domicile or situs here so that they shall, like domestic corporations, be within reach of the process of our courts. The term “transacting or doing business,” as used in laws of this character, implies continuity, and does not mean a single isolated transaction done within the borders of the state without any purpose of engaging generally in the carrying on of its business here. Cooper Mfg. Co v. Ferguson, 113 U. S. 727, 5 Sup. Ct. 739, 29 L. Ed. 1137; Florsheim v. Lester (Ark.) 29 S. W. 34, 27 L. R. A. 505, 46 Am. St. Rep. 162; Col. Iron Works v. Mining Co., 15 Col. 499, 25 Pac. 325, 22 Am. St. Rep. 433; Mearshon v. Lumber Co., 187 Pa. 12, 40 Atl. 1019, 67 Am. St. Rep. 560; Bank v. Sherman, 28 Or. 573, 43 Pac. 658, 52 Am. St. Rep. 811; D. & H. Canal Co. v. Mahlenbrock, 63 N. J. Law, 281, 43 Atl. 978, 45 L. R. A. 538.
Respondents cite and rely on that line of decisions wherein foreign banking or insurance corporations have been held not entitled to recover on contracts made with citizens of the state where the action was brought, because the corporations had not complied with the conditions imposed on such corporations in that state. Seamans v. Mill Co., 66 Minn. 205, 68 N. W. 1065; Ins. Co. v. Harvey, 11 Wis. 394; Seamans v. Temple Co., 105 Mich. 400. 63 N. W. 408, 28 L. R. A. 430, 55 Am. St. Rep. 457; Seamans v. Zimmerman, 91 Iowa, 363, 59 N. W. 290; Bank v. Young, 37 Mo. 398; Assur. Co. v. Rosenthal, 55 Ill. 85, 8 Am. Rep. 626. Those cases have no application to this case. By reason of the peculiar *61nature of some lines of business, such as banking and insurance, the legislatures of many states have imposed special restrictions upon the manner in which the business of such corporations shall be conducted. The object of such laws is usually to protect the citizens of the state from irresponsible companies or improvident contracts, and often to subject the business to taxation, or to protect its own citizens or domestic corporations from the disadvantages which would result to them if foreign corporations could do business in the state on less onerous terms than are imposed on domestic corporations of like character. We had occasion, in Walker v. Rein (recently decided) 106 N. W. 405, to apply the principles enunciated by this line of cases. The courts will not recognize the validity of any contract made by a foreign corporation with a resident of this state, or affecting property here, whether made in or out of the state, if the contract is one which domestic corporations generally are forbidden to make in this state, or if the contract is one which it is contrary to public policy to enforce. A contract of insurance upon property in this state, or upon the life of a resident thereof, without complying with the conditions imposed by our laws, is an evasion of the laws which the courts will not tolerate even if the contract were technically entered into beyond our borders. This is so, not because the corporation is a foreign one, but because it is the policy of the law to prohibit such contracts from being made with our citizens, or with respect to property in the state, without compliance with the conditions imposed by the statute. These objections do not apply to the transaction involved in this case, which, so far as the allegations of the complaint or the offers of evidence disclosed, was an ordinary bailment and a conversion by the bailee. The fact that a foreign corporation may have acquired some personal property in this state, or had occasion to bring it into this state for sale or safekeeping, does not of itself prove that the corporation was doing business here, within the meaning of the laws in question. Even were it so, it is open to question if the bailee could claim immunity against liability for its tortious act on the ground that the corporation had no right to do business here. That question is not before us, and we express no opinion thereon.
The case of Manufacturing Co. v. Farrar (S. D.) 104 N. W. 449, is not in point, because the South Dakota statute there construed and applied required compliance with its terms, not only *62as a condition precedent to the right to do business, but also as a condition precedent to the light to maintain an action. In this connection it may be proper to say, by way' of explanation, that section 3265 is a provision not appearing in our statute law until the revision of 1895, but sections 3261 and 3263 came down to us from the territorial laws. The latter section, however, changed the provision of the corresponding section of the territorial law with respect to the appointment of a resident agent. The transactions involved in Washburn Mill Co. v. Bartlett, 3 N. D. 138, 54 N. W. 544; Lumber Co. v. Children of Israel, 7 N. D. 46, 73 N. W. 203, and Loan Co. v. Shain, 8 N. D. 136, 77 N .W. 1006, all took place before section 3265 was enacted. In the case of National Cash Register Co. v. Wilson, 9 N. D. 112, 81 N. W. 285, section 3265, if applicable to the transaction involved, was apparently not noticed.
We also think that the court was in error in holding that the burden was on plaintiff to prove either a compliance with the statutory conditions, or that it was not doing business here in such a way as to be subject to those conditions. The case of Washington County Mutual Ins. Co. v. Chamberlain, 16 Gray (Mass.) 165, supports the views of the trial court. We have found no other case holding that view. That decision assigns no reason for the conclusion announced, and we cannot conceive of any satisfactory reason for such a rule. Foreign corporations are, by comity, entitled to recognition in this state, and to have their rights enforced and protected to the same extent as domestic corporations, subject to the rule set forth in section 5756, Rev. Codes 1899, as construed in Walker v. Rein (recently decided) 106 N. W. 405, unless, by reason of á violation of the constitutional or statutory provisions hereinbefore referred to, such recognition must be denied to them.. The presumption is in favor of their right to do business, because it is alwaj's presumed that persons will obey the law. He who asserts that there is illegality in a transaction, fair on its face, must plead and prove it. 1 Chitty, Pl. 220, 221. By reason of this general presumption in favor of legality it has been very generally held that a complaint, in an action by a foreign corporation, is not subject to demurrer for failing to allege compliance with conditions precedent to its right to do business or maintain suits. Acme, etc., v. Rochford (S. D.) 72 N. W. 466, 66 Am. St. Rep 714; American Ins. Co. v. Smith, 73 Mo. 368; Cassaday v. Ameri*63can, etc., 72 Ind. 95; Nelms v. Edinburg, 92 Atl. 157, 9 South. 141. We know of no good reason why that presumption does not continue as in other cases until overcome by proof. If the illegality of the contract sued on or the absence of the right to sue does not appear on the face of the complaint, the facts showing the illegality or absence of right to sue must be pleaded as a defense. If it is necessary for the defendant to plead those facts as a defense, it ought certainly to be incumbent on him to prove his allegations, unless the defensive facts are disclosed by plaintiff’s proof. A defense of this nature cannot be likened to a plea of nul tiel corporation. That plea is a mere denial of the allegations of the complaint with respect to the corporate capacit}' of the plaintiff. The defense relied on in this case admits the corporate capacity of the plaintiff, and is available only because the plaintiff is a corporation. It does not go to the capacity of the plaintiff to sue, but to the validity of the alleged cause of action.
(106 N. W. 406.)For these reasons the judgment must be reversed, and a new trial granted.
All concur.