Mr. Justice Moore,
after stating the facts, delivered the opinion of the court.
It is contended by plaintiff’s counsel that the limitation as to the time in which a suit may be commenced to foreclose a miner’s lien, as prescribed in the act creating the right, should be construed as pari materia with the genefal statutory limitation as to the time of com*307mencing actions, and tliat, if the act be given such interpretation, neither of the several causes of suit was barred when the corporation filed its answer. The act in question provides that the liens thereby created shall not bind the mine upon which the labor is performed for a longer period than six months after the claims therefor shall have been filed, unless within that time a suit be brought for their foreclosure: Laws, 1891, p. 76, § 4; 2 Hill’s Ann. Laws (ed. 1892), p. 1906. Section 16 of Hill’s Ann. Laws, prescribing a general limitation as to the time of commencing actions, provides : “If, when the cause of action shall accrue against any person who shall be out of the state or concealed therein, such action maybe commenced within the terms herein respectively limited, after the return of such person into the state, or the time of his concealment; and if, after such cause of action shall have accrued, such person shall depart from and reside out of this state, or conceal himself, the time of his absence or concealment shall not be deemed or taken as any part of the time limited for the commencement of such action.”
In Larson v. Aultman & Taylor Co., * 86 Wis. 281 (39 Am. St. Rep. 893, 56 N. W. 915), it was held that a foreign corporation is a “person out of the state,” within the meaning of the statute of Wisconsin which provided that “if, when the cause of action shall accrue against any person, he shall be out of this state, such action may be commenced within the terms herein respectively limited, after such person shall return or remove to this state.” Mr. Justice Cassoday, in rendering the decision of the court, says : “It is conceded that the defendant is a corporation created and organized under the laws of *308Ohio. It exists only in contemplation of, and by force of, the law of that state. Since such law has, of itself, no extraterritorial force, the corporation cannot migrate to another state,' but must dwell in the state of its creation.” To the effect that a foreign corporation is a “person out of the state,” see, also, Traveler’s Ins. Co. v. Fricke, 99 Wis. 367 (74 N. W. 372); Johnson Dry-Goods Co. v. Cornell, 4 Okl. 412 (46 Pac. 860). In Olcott v. Tioga R. R. Co., 20 N. Y. 210 (75 Am. Dec. 393), under a statute of New York identical with Section 16, Hill’s Ann. Laws, it was held that a foreign corporation sued in that state could not plead the statute of limitations in bar of an action. And this rule has been followed in Nevada : Robinson v. Imperial Min. Co., 5 Nev. 44; State v. Central Pac. R. R. Co., 10 Nev. 47; Barstow v. Union Con. Min. Co., 10 Nev. 386. The more modern rule, however, and the one most consonant with reason, is that a foreign corporation doing business within a state may plead the statute of limitations in bar of an action instituted therein, when it maintains an agent within such state upon whom service of process can be made for it: Huss v. Central R. R. Co., 66 Ala. 472 ; Lawrence v. Ballou, 50 Cal. 258; Pennsylvania Co. v. Sloan, 1 Ill. App. 364; Koons v. Chicago & N. W. Ry. Co., 23 Iowa, 493 ; Cobb v. Illinois Cent. Ry. Co., 38 Iowa, 601; Winney v. Sandwich Mfg. Co., † 86 Iowa, 608 (50 N. W. 565, and 53 N. W. 421); King v. National Exploring Co., 4 Mont. 1 (1 Pac. 727). The reason for this latter rule undoubtedly is that a debtor out of the state cannot impute laches to his creditors, or those claiming to have rights of action against him in not pursuing their remedies in a foreign jurisdiction; but when this excuse is rendered unavailing by the debtor’s coming into the state, the obligation *309upon their part to use the required diligence attaches; and a foreign corporation “returns” to the state, within the meaning of statutes of limitation, when it establishes an agent therein upon whom process can be served as its representative.
1. But, whatever the rule for the interpretation of the general statute of limitation may be, it can have no application to the case at' bar; for the exceptions to the operation of that statute cannot be invoked in aid of a suit to foreclose a mechanic’s lien, which must be commenced within the time prescribed in the act creating the right, or the lien is irrevocably lost: 15 Am. & Eng. Enc. Law, (1 ed.), 121; Boisot, Mech. Liens, § 721. In Dunning v. Stovall, 30 Ga. 444, a claim having been filed in pursuance of an act creating mechanics’ liens, and providing that suits for their foreclosure should be commenced within one year, it was held that the time within which such suit should be commenced was not affected by a subsequent act providing that the statute of limitations should not begin to run against open accounts until the first of January of the year next following. In Walker v. Burt, 57 Ga. 20, which was a suit to foreclose a mechanic’s lien, it was held that a general statute authorizing suits to be renewed within six months after their dismissal did not apply to suits to enforce mechanic’s liens. In Clark v. Manning, 4 Ill. App. 649, it was held that the provision of the statute of limitations excepting from its operation persons who were out of the state applied only to actions provided for in the chapter relating to limitations, and had no application to suits under the mechanic’s lien law. Limitations to the maintenance of actions were unknown at common law, but were adopted by courts of chancery to defeat a right which, in consequence of the laches of the party invoking the remedy, had become stale ; and legislative *310assemblies, for the purpose of promoting the peace of society, have adopted, with certain exceptions, the rule of equity thus established. But this rule, and the statute of limitations adopted in lieu thereof, were intended only to apply to common-law rights of action, and since a mechanic’s lien was unknown at common law, and is a creature of statutory origin, the general statute of limitations can have no application to it. Hence no error was committed by the court in sustaining the demurrer to the reply.
2. The more important question to be considered, however, relates to the action of the court in dismissing the suit; and its proper solution must depend upon whether the suit was commenced in time. The statute, Hill’s Ann. Laws, § 51, prescribing the manner of commencing actions reads as follows : “Actions at law shall be commenced by filing a complaint with the clerk of the court, and the provisions of sections 14 and 15 shall only apply to this subject for the purpose of determining whether an action has been commenced within the time limited by this code. At any time after the action is commenced the plaintiff may cause a summons to be served on the defendant: ’ ’ The sections therein referred .to provide as follows: Section 14, “An action shall be deemed commenced as to each defendant when the complaint is filed and the summons served on him, or on a co-defendant who is a joint contractor, or otherwise united in interest with him and section 15, “An attempt to commence an action shall be deemed equivalent to the commencement thereof, within the meaning of this title, when the complaint is filed, and the summons delivered, with the intent that it shall actually be served, to the sheriff or other officer of the county in which the defendants or one of them usually or last resided; or if a corporation be defendant, to the sheriff or other officer *311of the county in which such corporation was established by law, or where its general business was transacted, or where it kept an office for the transaction of business. But such an attempt shall be followed by the first publication of the summons or the service thereof within sixty days:” Hill’s Ann. Laws, § 61, is made applicable to suits in equity by Hill’s Ann. Laws, § 389. It will be remembered that the complaint herein was filed in the proper court within six months after the liens were filed, but a longer period had elapsed before a summons was served upon the corporation by a publication thereof. If sections 14 and 15 qualify section 51, the filing of a complaint is not the commencement of a suit, within the meaning of the miner’s lien law; but, if they only limit its application to the statute of limitations, and as far as this suit is concerned are to be eliminated therefrom, then the suit was commenced within the time prescribed. The editors of the Encyclopedia of Pleading and Practice (vol. 1, p. 136), in commenting upon Section 51, Hill’s Ann. Laws, as modified by section 14, say: “In Oregon an action is deemed commenced, within the meaning of the statute of limitations, when the complaint is filed and the summons is served on the defendant; but for all purposes other than that of the statute of limitations actions are commenced by filing a complaint with the clerk of the court.” Quoting further from that valuable work (vol. 13, p. 946), it is said : “What shall be deemed a commencement of suit to enforce a mechanic’s lien is usually a matter of statutory regulation. If the proceedings to foreclose are by bill in equity, the filing of the bill is considered the commencement of suit, in the absence of statutory provisions to the contrary.” “The filing of the petition or complaint to enforce a lien,” says Mr. Jones, in his work on Liens (vol. 2, § 1562), “is gen-*312orally the commencement of the suit.” In Sheridan v. Cameron, 65 Mich. 686 (32 N. W.. 894), it is held that the filing of a bill or petition is the beginning of a suit under the mechanic’s lien law, the service of process being only a step in the cause. In Flandreau v. White, 18 Cal. 639, it was held that the provision in the general statute of limitation that the filing of the complaint shall be deemed a commencement of the suit applied to that act only, and not to the mechanic’s lien law.
From these authorities we think it evident that the qualification to Section 51, Hill’s Ann. Laws, applies only to the statute of limitation, and, as a suit to foreclose a mechanic’s lien is not governed thereby, it follows that such qualification, as far as the case at bar is concerned, is eliminated therefrom. The act creating miners’ liens not having prescribed the manner in which suits for their foreclosure should be instituted, the filing of the complaint is the commencement of the suit, within the meaning of the act: Coggan v. Reeves, 3 Or. 275. The suit having been commenced within the time prescribed, the court erred in dismissing it; and hence it follows that the decree is reversed, and the cause remanded for such further proceedings as may be necessary, not inconsistent with this opinion.
Reversed.