This case arises out of a petition charging Dorothea Wilson and Freeman C. Wilson with contempt of court.
The record discloses that the plaintiff in the bill in equity purchased and acquired from the defendant on May 15, 1948, certain real estate in the Town of Sebago, Cumberland County, Maine, consisting of a dwelling house and store (known as Bob’s Store) and the fixtures, good will and stock in trade, etc. of said store. The transaction was evidenced in part by two bills of sale, each of which contained a similar specific agreement on the part of the defendant that he would not enter or engage in the same line of business, either alone or in partnership, directly or indirectly, in the Town of Sebago for a period of five (5) years from May 15, 1948, in competition with the plaintiff or his successors. There were certain minor exceptions not pertinent in this case. The record further discloses that on or about the latter part of July, 1948, the plaintiff filed a bill in equity in the Supreme Judicial Court for Cumberland County praying for an injunction, both temporary and permanent, alleging that the defendant had violated the specific agreements with respect to competitive business hereinbefore mentioned. The matter came on to be heard on October 15, 1948, on bill and answer, and subsequently, on November 5, 1948, the findings of the court were filed and on November 23, 1948, a final decree was filed which granted a permanent injunction not only against the defendant, Gerald Gilman, but also against Alice Gilman, Dorothea Wilson and Freeman C. Wilson, and forbade the said defendant and said Alice Gilman and said Dorothea Wilson and said Freeman C. Wilson from carrying on a business such as was conveyed to the plaintiff, Angelí, by the defendant, Gerald Gilman, and it also forbade the use by said Dorothea Wilson and said Freeman C. Wilson of certain equipment transferred and sold by the defendant for use in the business such as was conveyed to the plaintiff by the defendant. Attested copies of the permanent injunction *204issued as aforesaid were served upon said Dorothea Wilson and said Freeman C. Wilson on November 26, 1948.
From the findings of the sitting- justice it is apparent that the defendant, shortly after the conveyance of the business and good will thereof to the plaintiff with the specific agreement not to engage in competitive business, either directly or indirectly, began the construction of a building in proximity to the store which had been conveyed to the plaintiff by the defendant which building was to be adapted to a store on property owned or in the name of the defendant’s wife, Alice Gilman. It further appears that on October 1, 1948, while the present action was pending, said Alice Gil-man, with knowledge of her husband’s specific agreement contained in the bills of sale hereinbefore mentioned, made a lease of the property upon which the new store building was located to said Dorothea and said Freeman C. Wilson and at the same time the defendant conveyed to said Dorothea and said Freeman C. Wilson equipment to be used in a general store, together with his gasoline business. After the issuance of the injunction and the service thereof, a petition for contempt was filed by the plaintiff against said Dorothea Wilson and said Freeman C. Wilson, returnable December 10, 1948. Answer of the respondents was filed as was also a stipulation which, in substance, admitted that said Dorothea Wilson and said Freeman C. Wilson, after the service of the attested copies of the permanent injunction had been served upon said Dorothea Wilson and said Freeman C. Wilson, continued to sell groceries and to carry on and operate a business such as was conveyed to the plaintiff by the defendant in the Town of Sebago, Maine. A hearing was held December 10, 1948, and at the conclusion of said hearing, said Dorothea Wilson and said Freeman C. Wilson filed a motion to dismiss said petition for contempt alleging as grounds therefor that the court had no jurisdiction as to said Wilsons on the ground that they were not made parties defendant in the bill in equity which motion *205was denied by the court and the respondents seasonably excepted.
On January 14, 1949, the court adjudged the respondents to be guilty of contempt to which ruling the respondents, namely, said Dorothea Wilson and said Freeman C. Wilson, seasonably excepted and subsequently said exceptions were allowed by the sitting justice and the matter is now before this court for decision.
At no stage in the proceedings were said Alice Gilman, said Dorothea Wilson or said Freeman C. Wilson made parties to the bill in equity.
The motion to dismiss the petition for contempt filed December 10, 1948, raises a jurisdictional question. If jurisdiction is lacking, it is fatal in every stage of a cause and may be and should be brought to the attention of the court at any time, and when it appears that the court has no jurisdiction, it becomes the duty of the court to stay the proceedings and permit amendments, if allowable, or dismiss the action. Darling Automobile Company v. Hall et al., 135 Me. 382; 197 Atl. 558; Powers v. Mitchell, 75 Me. 364; Charles Cushman Co. et als. v. William J. Mackesy et al., 135 Me. 490; 200 Atl. 505; 118 A. L. R. 148; Whitehouse Equity Practice (1st Ed.) Sec. 193.
The real issue raised by the exceptions has to do with the question of whether or not an injunction may be issued under such conditions as exist from the record in this case against persons not made parties to the cause before the court. If the writ of injunction, which is an extraordinary remedy and discretionary, as well, can be issued under such circumstances as have been here described, then the court had jurisdiction of the parties. If it cannot be issued under such circumstances, then jurisdiction is lacking and the motion to dismiss should have been granted. In this State it has long held that all persons are to be made parties who are legally or beneficially interested in the subject matter
*206and result of the suit. Evans v. Chism, 18 Me. 220, 222. This fundamental principle concerning parties is stated in another way in the following language:
The fundamental principle concerning parties is, that all persons in whose favor or against whom there might be a recovery, however partial, and also all persons who are so interested, although indirectly, in the subject matter and the relief granted that their rights or duties might be effected by the decree, although no substantial recovery can be obtained either for or against them, shall be made parties to the suit.
Pomeroy Equity Jurisprudence, Vol. 1, Page 98, Sec. 114. To the same effect see Story’s Equity Procedure, 8th Ed., Sec. 72, 76c; also Whitehouse’s Equity Practice, Sec. 153, 156 inclusive. There are certain exceptions to this general rule which are not pertinent in the instant case. The following cases are in point in all of which the general rules hereinbefore mentioned are followed: Felch v. Cooper, 20 Me. 159; Hussey v. Dole, 24 Me. 20, 24; Bailey v. Myrick, 36 Me. 50, 52; Beals v. Cobb, 51 Me. 348, 349; Chamberlain v. Lancy, 60 Me. 230, 234; Hichborn v. Bradbury, 111 Me. 519, 525; 90 Atl. 385; Hyams v. Old Dominion Cl., 113 Me. .337, 340; 93 Atl. 899. The more recent case of Medico v. Assurance Corp., 132 Me. 422, 425 (172 Atl. 1) summarizes "the present law as to who are necessary or indispensable parties.
Applying the general rules set forth in the above cited ■cases to this case leads only to one conclusion and that is "that under the findings of the sitting justice said Dorothea "Wilson and said Freeman C. Wilson, the respondents in the petition for contempt and also the persons named in the permanent injunction herebefore mentioned, had a material interest in the subject matter of this case and, therefore, •should have been made parties defendant before an injunction should have been issued against them. It, therefore, follows that the petition for contempt cannot, under such *207circumstances, be maintained for lack of jurisdiction of the respondents nor had the sitting justice any right under the existing law to issue an injunction against the respondents, said Dorothea and said Freeman C. Wilson, under the bill in equity filed in this proceedings until and unless said Dorothea Wilson and said Freeman C. Wilson were made parties to the cause, either on motion of the complainant or on the court’s own motion. The exceptions are sustained and the contempt proceedings are ordered dismissed and the injunction against the respondents, said Dorothea Wilson and said Freeman C. Wilson, is hereby ordered vacated and dissolved. Inasmuch as there may be equities between the parties in this cause which should be determined and adjusted, the case is remanded to the sitting justice below for action in accordance with the opinion.
So ordered.