This is an appeal from an order denying the motion of the appellant to vacate and set aside a judgment rendered in favor of the respondent by default, the appellant not having appeared in the action. The summons and complaint were served upon A. J. Fairchild, at Milbank, in Grant county, in this state, and upon Albert Wildborg, at Big Stone City, in said county. The sheriff, in his amended return, states that he duly served the summons and complaint upon the persons, above named, who were the managing agents of said defendant. The appellant assigns as error that the court erred in denying appellant’s motion to vacate and set aside the said judgment, as the court acquired no jurisdiction of the person of the appellant. It appeared that the appellant was a foreign ■corporation, organized and existing under the laws of the state of Minnesota, but it also appeared that it had property and places of business in this state. It also appeared from the proof offered by appellant that it had never filed a copy of its articles of incorporation in the office of the secretary of state, nor its appointment of an agent authorized to accept service of process, as required by the laws of this state.
Two questions are presented for our decision. (1) Can service of a summons be legally made upon the managing agent of a foreign corporation, in this state, who has not been appointed by the corporation in the manner prescribed by the statute of this state? And (2) were the persons upon whom the service in this case was made “managing agents” of the appellant, within the meaning of the statute of this state relating to the service of summons upon foreign corporations? The section of the statute relating to such service is section 4898, Comp. Laws, and reads as follows: “The summons shall be served by delivering a copy thereof, as follows: (1) If the *62action be against a private corporation, to the president or other head of the corporation, secretary, cashier, treasurer, a director, or managing agent thereof; but such service can be made in respect to a foreign corporation only when it has property in this territory, or the cause of action arose therein, or when such service shall be made within this territory personally upon the president, treasurer", secretary, or duly authorized agent thereof.” The learned counsel for appellant contend that, under this section, service can only be made upon a foreign corporation by serving the summons upon the president, treasurer, secretary, or duly authorized agent, as provided in the last clause of the section, and that service can only be made upon a managing agent in case of domestic corporations. But we cannot agree with the counsel in this construction of the statute. In our opinion the language of the section will not bear that construction. The first clause of the section clearly applies to all private corporations, whether domestic or foreign. No distinction is made in that clause between the two classes. But by the second clause a condition of such service is made, not as to the persons upon whom service may be made, but under what circumstance such service can be made; and it provides: “But such service can be made in respect to a foreign coi’poration only when it has property in this territory, or the cause of action arose therein.” The expression “such service’’ evidexxtly refers to the service specified in the preceding clause, as there is- no other service to which it can properly refer. The third and last clause of the section provides for a different service, which may be made when the foreign corporation has no property in this state, and the cause of action did not arise thex-ein. The leaxmed counsel for the respondent coxitends ‘ ‘that the section authorizes service on the managing agent of a foreign coi’poration when it has property in this state, or the cause of action arose therein; and that when neither of these conditions exists, service can be made only upon the president, secretary or duly authorized agent. We are of the opinion *63that this is the true construction of the section. This seems to be the construction placed upon a somewhat similar provision of the practice act of New York, whence the section we are considering apparently came. Brewster v. Railroad Co., 5 How. Pr. 183; Sterett v. Railroad Co., 17 Hun. 316; Reddington v. Mining Co., 19 Hun. 405; Tuchband v. Railroad Co., 115 N. Y. 437, 22 N. E. 360. We are not able to discover any valid reason why any distinction should be made as to the service of process between the managing agent of a domestic and a foreign corporation when such corporation has such a managing agent within this state, and we think the lawmaking power has made none.
The counsel for appellant further contend that inasmuch as the appellant had never filed its articles of incorporation with the secretary of state, nor its certificate of the appointment of an agent, as required by the law of this state, it was not legally doing business within the state* and could not legally have a managing agent therein, on whom service could be made. But we cannot assent to this proposition. The failure of appellant to comply with the laws of this state cannot be taken advantage of by itself, nor in fact by any private person in a collateral proceeding. The state only in its sovereign capacity, can take advantage of snch failure of a foreign corporation to comply with the law. Wright v. Lee, (S. D.) 51 N. W. 706, 55 N. W. 931. If a foreign corporation is engaged in business in this state, though failing to comply with the laws by filing a copy of its articles of incorporation and a certificate of the appointment of an agent, it is still subject to the laws of the state,- and ameanable to its process, until its right to so continue to do business within this state is declared forfeited by the courts of the state, upon due proceedings taken in the name of the state. The person transacting the business of the corporation in this state, as managing agent, must be presumed to be the agent of the corporation, and subject to the service of process. In Hagerman v. Slate Co., 97 Pa. St. 534, the supreme court of *64Pennsylvania said: “When a foreign corporation, transacting business in this state, has failed to establish an office, and report the name of an agent, * * * but has some person residing therein as its agent, it must be presumed that the corporation has substituted such agent as the one on whom service is authorized to be made, to the extent, at least, of its unfinished business in this state.” This seems to be the true rule. If a corporation fails to comply with the laws of the state, but is still engaged in business therein, and permitted to carry on such business, it must transact its business here subject to the laws of the state, and its assent to service upon its managing agent is implied. The general rule is thus stated by the supreme court of the United States, in St. Clair v. Cox, 106 U. S. 350, 1 Sup. Ct. 354: “The state may therefore impose, as a condition upon which a foreign corporation shall be permitted to do business within her limits, that it shall stipulate that, in any litigation arising out of its transactions in this state, it will accept as sufficient the service of process upon its agents or persons specially designated; and the condition would be eminently fit and just. And such condition and stipulation may be implied as well as expressed. If a state permits a foreign corporation to do business within her limits, and at the same time provides that, in suits against it for business there done, process shall be served upon its agents, the provision is to be deemed a condition of the permission; and corporations that subsequently do business in the state are to be deemed to assent to such condition as fully as though they had specially authorized their agents to receive service oi the process.” Thomas v. Mining Co., 65 Cal. 600, 4 Pac. 641; Funk v. Insurance Co., 27 Fed. 336; Knapp, Stout & Co. v. National Mut. Fire Ins. Co., 30 Fed. 607; Moch v. Insurance Co., 10 Fed. 696; Pringle v. Woolworth, 90 N. Y. 502; Pope v. Manufacturing Co., 87 N. Y. 137; Tuchband v. Railroad Co., 115 N. Y. 437, 22 N. E. 360.
This brings us to the consideration of the second question; *65Were tlie parties upon whom tlie service of the summons in this case was made the managing agents of the defendant? The defendant, in support of its motion to vacate and set aside the j udgment, read the affidavit of the president and secretary of said defendant. The material part of the affidavit of the president is as follows: “That on the first day of December, A. D. 1890, H. J. Benedict, Esq., assuming to actas the sheriff of said county of Grant, in the state of South Dakota, * * * * did levy upon and take into his custody, as said sheriff, under said writ, a large quantity of lumber, lath, shingles, and other personal and real property of and belonging .to the said Charles Betcher Lumber Company, then and there being at and situate in Milbank, and also Big Stone City, (each and both of said places are in the said county of Grant, and state of South Dakota,) and which said personal and real property was then and there of great value, to-wit,of the value of sixteen thousand ($16,-000) dollars. * * * The said personal and real property of said Charles Betcher Lumber Company at said Big Stone City, in said county, was on said day of said levy in the charge of Albert Wihlborg, a hired employe of said corporation; and the said personal and real property of said Charles Betcher Lumber Company at said Milbank, the day of said levy, was in charge of said A. J. Fairchild, Esq., an employe of said corporation. ” The affidavit of the secretary is substantially the same. It will be noticed that the affidavits admit that the defendant was engaged in the lumber business at Milbank and Big Stone City; that the two persons named were in their employ, and inferentially had charge of defendant’s business at the places named. It will be further noticed that it is not in terms denied that they were managing agents, but they were designated in the affidavits as “employes.” It is nowhere stated in the affidavits that the defendants had any other agents or persons in charge of their business in this state. On the part of the plaintiff, a number of affidavits were read on the hearing, two being made by the *66two agents, on whom the service of the summons and complaint was made. The material part of the affidavit of A. J. Fairchild is as follows: “A. J. Fairchild, being duly sworn, says that for the past twenty-two months, and until the 1st day of December, 1890, and on that date, he.Ayas, the duly authorized, acting and managing agent, and the only agent, of Charles Betcher Lumber Company, the defendant in the above entitled action, and also a foreign corporation, whose main office and principal place of business is in the city of Red "Wing in the state of Minnesota, at the city of Milbank, in the county of Grant, and state of South Dakota; that, as such agent, he had full charge of the business of said corporation at said city of Milbank, and was subject to no authority from any other person or agent in said state of South Dakota; that he accounted to said corporation," and received all instructions from the main office thereof, at said city of Red Wing, Minn.; that he conducted and managed the affairs and business of said corporation at said city of Milbank, and, in its behalf, he received and disbursed all moneys, sold lumber and merchandise, paid freight, made contracts and agreements with customers as to terms of payment of accounts, issued receipts for money for said corporation, as agent thereof, employed all necessary temporary assistance for said corporation, and transacted all of the business of said corporation at said city of-Milbank.” The affidavit of Albert Wihlborg, the agent at Big Stone City, was more full and specific as to the nature of the agency, but we will insert only a few paragraphs of the same: “Affiant further states, on oath, that at the instance, and by and with the consent and instructions, of the said Charles Betcher Lumber Company, he insei'ted in a certain newspaper, the Western Wave, published at said city of Big Stone City, an advertisement of ihe business of the said Charles Betcher Lumber Company, including the name of affiant as agent thereof; * * * that affiant had full power and authority to hire laborers as he deemed best from time to time, to make contracts with them for the amount of *67their hire, and to pay the same, and that affiant had power and authority from the said Charles Betcher Lumber Company to bring suits in the name of said Charles Betcher Lumber Company whenever he deemed the same to be necessary for the protection of the interests of said corporation, to engage attorneys for the prosecution of said suits, and to settle and adjust the claims upon which such suits were based; * * * that affiant at all times during his connection with the said Charles Betcher Lumber Company, at the city of Big Stone City, [has been] held out to be, and has been, and has been authorized by the said Charles Betcher Lumber Company to hold himself out to be, the sole agent of the said corporation at the city of Big Stone City, for the general transaction of its business in all its details; that at no time during affiant’s connection with the said Charles Betcher Lumber Company has any person or persons in the state of South Dakota had or executed any authority or superintendency over him in his connection with the business of said corporation at the city of Big Stone City, and that he was, up to and including the said 1st day of December, 1890, the sole agent of said corporation at said Big Stone City, as aforesaid, and not otherwise; that affiant, as such agent, received from said corporation an annual salary.” It was also shown that from August 8th to the 17th day of October, 1889, the said Fairchild had an advertisement published in the Grant County Review, a newspaper published in said county, as follows: ‘ ‘Charles Betcher Lumber Co. A. J. Fairchild, Manager. * * Office and Yards, Third Ave. and Second Street, Milbank, South Dakota.” It was also shown that from May, 1890, to January 15, 1891, the following advertisement was placed in the Western Wave, a newspaper published in said Grant county: ‘ ‘Charles Betcher Lumber Company. * * * Albert Wihlborg, Manager. ” It was also shown that said Wiblborg had filed several mechanics’ liens on behalf of said defendant, and as the agent of said company, some of which he had settled and released as such agent.
*68While the term “managing agent” has no strict legal definition, and it is not easy to formulate or lay down a general rule that will govern alí cases, yet we are of the opinion that the facts in this case show that both Fairchild and Wihlborg were “managing agents” within the meaning of the statute. The latest and perhaps the most satisfactory definition of a managing agent is that laid down by the court of appeals of New York in Tuchband v. Railroad Co, supra. The court says: “(2) Whether Oberg within the meaning of the code (supra) was the ‘managing agent. ’ The defendant, like other railroad corporations, necessarily has not only directors, a treasurer and secretary, but other officers and agents. By these persons, or under their direction, by others, the business of the company is conducted. From the very nature of a body corporate, service of process cannot be personal, and at common law it was made by serving it on a proper officer; so that it might come to the knowledge of the company, and then further proceedings by distress. 1 Tidd Pr. 121. Under the statute [supra] the same object was in view; and when the corporation has an office in this state where a substantial portion of its business is transacted by a person designated by itself as a ‘general agent,’ although followed by words indicating some one department, it may safely be assumed that the object of the statute will be accomplished. It, of course, intends a managing agent in this state, and, where a corporation created by the laws of any other state does business in this state, the person who, as its agent, does that business, should be considered its managing agent, and more especially should that be so where the foreign corporation has an office or place of business in this state, and when that office is in charge of that person, and he there' acts for the corporation. He is there doing business for it, and so manages its business. Such person is, in every sense of the words used in the statute, a managing agent. * * * So far as the cases cited by the appellant hold a contrary doctrine, they cannot be approved. To limit service by requiring the person served, in *69case of an.actioi against a railroad corporation, to be one who controls ‘ ‘the general and practical operations and business of running the road, ’ would so restrict the meaning of the statute as to render it useless. Such an agent would naturally find his occupation and engagement in the state where the road was domiciled or operated; and if his incidental presence in this state subjected him to process, as representing the corporation, it cannot be supposed that the legislature intended to confine the remedy to him alone.” The case of Express Co. v. Johnson 17 Ohio St. 641, is directly in point, and the law is so clearly stated that we quote the decision in full: ‘ ‘By the Court. The plaintiff, who was defendant in the original action, is a foreign corporation, and the principal ground of error relied on is the alleged insufficiency of the service of the original summons. At the time of service the company had a general ‘superintendent’ for the state, residing at Cleveland, and two or more ‘local agents’ in the county of Madison, one of w;hom resided in London, in said county, and kept an office there, where he received and forwarded packages for the company, and did all the business of the company usually transacted in such receiving and forwarding offices. Service was made upon the said agent at London alone; and the question is, whether he was the ‘managing agent’ of the company, within the meaning of the sixty-eighth section of the code? We think he was. such managing agent, and that the service was sufficient.” In McAllister v. Insurance Co., 28 Mo. 214, the court says: “It would seem to be a reasonable interpretation of the language of the twenty-sixth section of the attachment law that an agent of a foreign insurance company located here, and doing business under this law of 1855, should be deemed a ‘managing officer’ of such corporation for all the purposes of an attachment or garnishment. Such agents do in fact represent the corporation here, although in the foreign country where the corporation has been chartered and its chief place of business is, there is another chief officer of such corporation. We are not aware of any principal *70of public policy which could induce the legislature designedly to discriminate between domestic insurance companies and these agencies of foreign insurance companies which they have allowed to transact business here with all the privileges of domestic corporations, so as to exempt the latter from liability to a process to which the former is undoubtedly liable.” Lumber Co. v. Stone, (Neb.) 27 N. W. 395. The case of Tuchband v. Railroad Co., supra, shows that the principles laid down in some of the earlier cases in New York, cited by appellant’s counsel, are in effect overruled. As showing what agents are not regarded as managing agents, we quote briefly from Reddington v. Mining Co., 19 Hun. 405: “Hence arises the material question upon this appeal, viz, whether Brumagim can be regarded a ‘managing agent’ of the corporation, within the meaning of said statute, so as to authorize the service upon him of a summons, in order to commence an action in this state. The duties which were assigned to Brumagim by the company were restricted in regard to their nature and extent, and the performance of such duties was subject to the direction and control of the company. We do not perceive that any exercise of independent judgment was confided to him, and he seems to have acted entirely in a subordinate capacity. * *• * It is quite clear that the legislature attached importance to the term ‘managing agent,’ and employed it to distinguish a person who should be invested with general power, involving the exercise of judgment and discretion, from an ordinary agent or employe who acted in an inferior capacity, and under the direction and control of superior authority, both in regard to the extent of the work and the manner of executing the same. The distinction thus attempted to be drawn we deem reasonable, and in harmony with the obvious purpose of the statute in regard to the service of process upon a foreign corporation. It would, indeed, be a great hardship to allow actions to be commenced against foreign corporations by the service of a summons upon an inferior agent or servant, who, by reason of ignorance or *71heedlessness, would be quite likely not to apprehend the purpose of such service, and therefore neglect the same. ” In the latter case, Brumagim was simply employed in the city of New York as transfer agent of the defendant's stock, and was authorized to collect assessments, and remit them to the company. In the former case, decided by the court of appeals some ten years later, Oberg, the agent, was described in the company’s time table as “General Agent, Passenger Department, 261 Broadway, N. Y.” He had nothing to do with the freight department, but he occupied an office over which was the sign, “Chicago & Alton R. R.,” etc., which, as the court says, indicated that the office was a general office, for the transaction of railroad business connected with the defendant’s line in that city. It seems to us that the facts of the case at bar clearly bring the agents with-in the principle of the case in the 115 N. Y., 22 N. E. Fairchild had charge of the entire business of the defendant at Milbank, paid freights, made contracts, hired and dischai’ged men, and held himself out to the public and advertised himself as manager. He exercised, in all the business of the defendant at that point, discretionary powers and independent judgment. He was subject only to the control of the company, with which he corresponded directly. The deftndant had an office and lumber yard entirely under the control of Fairchild, subject, of course, as all managing agents, to the control of the corporation. The same may be said of Wihlborg at Big Stone City. He occupied a place of business, where the lumber of the defendant was sold and dealt in, under his sole charge; and he held himself out and advertised himself, under instructions of the defendant, as manager. He, too, exercised discretion and an independent judgment in the management of the business, and received, as such manager, an annual salary. Neither of these agents occupied the position of “inferior agents” or “servants,” in the ordinary sense in which those terms are used, or were used by the court in the cases quoted from. 19 Hun. We have examined all the authorities cited by *72counsel for the appellant to which we have access, but they were, in nearly all cases, decided under provisions of statutes so dissimilar to our own, or the agent’s powers were so limited, as to afford us but little aid in deciding the question before us. Our conclusions are that the learned circuit court was clearly right in denying the appellant’s motion to set aside and vacate the judgment rendered in this case, and that the order appealed from should be affirmed. The order of the circuit court is therefore affirmed.