OPINION' OP THE COURT.
ROBERTS, J.In the year 1900 seven distinct community acequias were named in an amended complaint filed in the district court of Santa Fe county as plaintiffs in an action against the Acequia de Las Joyas del Llano Frio, sometimes called the Acequia Nueva. Teófilo Lopez, its mayordomo, and one Juan Antonio Mirabal, governor of the pueblo of Nambe, were made defendants. The complaint alleged that the acequias plaintiffs were public acequias and corporations, located in precinct No. 1 of said county, and that from time immemorial they had existed as such and had taken water as such from the Rio de Nambe; that there were approximately 274 individual participants under such plaintiff 'acequias who were the owners of water rights, and of irrigable and cultivable lands adjacent to said acequias; that said acequias had, from the time of their construction, the actual need and use of all the waters of the Rio de Nambe, for the proper irrigation of the lands of the participants; that the defendant acequia was constructed in the year 1895, and that in March, 1900, it was connected directly with the Rio de Nambe, above the intake of the seven plaintiff acequias; and that said defendant used a large portion of the water of said river which properly belonged to the plaintiffs and their participants, and that as a result plaintiff acequias were unable to properly irrigate the lands of their individual participants. The prayer of said complaint was for an injunction restraining the defendants from taking, using, or diverting any of the waters of the Rio de Nambe into the new ditch, and for damages.
To the amended complaint the defendant Teofilo Lopez interposed a demurrer, raising several legal propositions, among which was that of the jurisdiction of the court. The record shows no ruling on the demurrer. On the same day that the demurrer was filed an answer was -filed containing a general denial and allegations to the effect that the acequias plaintiffs and defendant were in fact private and not public acequias, and expressly denied that they were corporations, competent to sue and be sued.
The governor of the pueblo of Nambe, which is an Indian village, denied the ownership of the water rights by the plaintiffs or their individual participants, and denied that the said acequias plaintiffs were public acequias or corporations under the law; alleged that the pueblo derived its rights and title from the crown of Spain, and set up facts tending to show prior rights in the said pueblo.
The final judgment entered in the case on the 16th day of April, 1902, found that the acequias plaintiffs were each public acequias or corporations; that they had prior right to the water, except a certain portion awarded the Pueblo of Nambe. The decree then prescribed a certain use of the water from said river to the pueblo, but made said rights secondary to the rights of the plaintiffs. In .1903 a proceeding was instituted to secure the punishment of the officers of the defendant acequia for violating the decree, which resulted in a fine being imposed upon said parties.
In the month of August, 1913, a second suit was instituted in the district court of Santa Fe county by practically the same plaintiffs as appeared in the original action, praying an injunction against the Acequia de Las Joyas del Llano Frio (Acequia Nueva) and Miguel Herrera, restraining them from withdrawing the waters of the Rio de Nambe into said new ditch, contrary to the terms of the original decree. Respondent’s return, besides a general denial, alleged that said original decree was not binding upon them for the reason that all the parties necessary to fix and determine said water rights had not been joined in said cause; that there was a defect of parties in that the individual appropriators had not been joined in said original cause, without whose presence in court a full and complete determination oí the questions involved could not be had.
Beplication was filed by the plaintiffs in that suit on the 26th day of June, 1914. After a hearing on the merits final decree was rendered by the court by the terms of which a temporary injunction, theretofore issued, was made permanent, and the defendants were permanently restrained from taking, using, or diverting any of the usual flow .of the Bio de Nambe, and the former decree in cause No. 4144, the first suit, was affirmed and adhered to in all respects, and the same ivas held to be in full force and effect.
On September 10, 1917, Bobert B. Bridgers, one of the participants of the seven ditches, in whose favor the old decrees were entered, filed an application, entitled in the two old numbered cases, but docketed as eause No. 8885, praying for an order citing Jose Inez Boybal, Jose Antonio Salazar, and Julio Garduño to show cause why they should .not be punished as for contempt of court for vio-, lating the decrees entered in causes numbered 4144 and 8052, and for withdrawing and using the waters of the Bio de Nambe contrary to the terms thereof.
Bespondents interposed a demurrer to said petition upon the grounds: First, that respondents had no notice of the contents of said decree; second, that they were strangers to said decree and not bound thereby; and, third, that the 'acequias plaintiffs in the original causes had no power or authority of law to sue and determine water rights, and that therefore the decrees were entered without jurisdiction and void.
Upon the hearing upon the issues thus raised, the trial court sustained the demurrer and quashed the information or citation “for the particular reason that the judgments alleged to have been disobeyed were void in that the corporations, plaintiff and defendant in the original causes, were without capacity to sue and be sued in the matter of said original causes,” and judgment was entered dismissing the petition. To reverse that judgment this appeal is prosecuted.
[1, 4] Chapter. 1, Laws 1895 (section 5744, Code 1915), made all community ditches or acequias corporations or bodies corporate, with power to sue or be sued as such, and provided for the administration of such corporations. This act was fully considered by this court in the case of Snow v. Abalos, 18 N. M. 681, 140 Pac. 1044, and it was upon a construction of that decision that the court sustained the demurrer. We there held that the above act did not confer upon the community acequias the power to acquire or hold title to the water rights; that the water right was a several right, owned and possessed by the individual user; that the ditch through which the water was carried was owned by the participants, as tenants in common; that the water right was not attached to the ditch, but was appurtenant to the lands irrigated, and the water rights were owned by the parties in severalty; that in an action for the adjudication of water rights the individual consumer was a proper and necessary party. In the present case, the court being of the opinion that the two actions referred to herein indirectly adjudicated water rights, and the individual owners of the rights not having been made parties to the suit, the decree was void and could be attacked collaterally. The individual consumers not having been made parties, were-not, of course, bound by the decree, and their rights to use the water could not be adjudicated in an action to which they were not parties. That the decree is not binding upon them is evident, but the question raised by the demurrer and which was sustained by the court involves a different proposition; i. e., whether the decree was binding upon the parties to the action until such decree was set aside in a proper proceeding. The question was raised in the original suits as to the right of the court to issue the injunction against the acequia corporation and its officers without the individual participants having been made parties, and the court ruled against this contention. This ruling may have been erroneous as a matter of law, and the petition may not have stated facts sufficient to constitute a cause of action. A judgment will not be considered open to collateral impeachment because the petition or complaint in the action in which it was rendered did not constitute a cause of action. Black on Judgments, § 269, Van Fleet’s Collateral Attack, § 61. The universal rule adhered to by the courts is that the judgment or final order of a court having jurisdiction of the subject-matter and the parties, however erroneous, irregular or informal such judgment or order may be, is valid until reversed or set aside. Black on Judgments, § 190. And the general rule is that an error of law does not furnish ground for collateral attack on a judgment. 15 R. C. L. 861.
In the original suits the action was instituted by corporations having the power to sue against a corporation which could rightfully be sued under the statute, and certain named individuals. It is the contention of appellee, however, that such corporations, created solely for administrative purposes, should only be sued in matters or actions concerning the administration of the community acequias, and that such corporations could neither sue nor be sued where the gist of the action involved the individual water rights of the participants under the acequia.
Until the decision in the case of Snow v. Abalos, supra, the rights and duties of such corporations under the statute had not been definitely settled in this jurisdiction. It was an open question upon which members of the bar disagreed as to whether the water rights were owned by the community corporation or were held in severalty by the participants. The court, in reaching its conclusions in the two original suits filed herein, was evidently of the opinion that the water rights belonged to the corporation, and that it had the right to protect such rights by an injunction. This view of the law was erroneous in view of the decision in the Snow-Abalos Case, but that did not render the judgment void in that case and subject to collateral attack.
[5] A judgment cannot be impeached by showing that it was based upon a mistake of law. American Express Co. v. Mullins, 212 U. S. 311, 29 Sup. Ct. 381, 53 L. Ed. 525, 15 Ann. Cas. 536.
The court in the two cases referred to was confronted with the question as to whether or not the community'' acequias had the right to prosecute the action for injunction and to protect the water rights in question, and it was its' duty to decide this question, and its decision, although it may have been erroneous, was not subject to collateral attack. 15 R. C. L. 861. And the judgment is binding upon the party, although it is undoubtedly erroneous under the law as subsequently declared by the courts. It does not require much discussion to show that the above is the correct view. Take the case, for example, of Snow v. Abalos, supra, where we held that the individuals were the proper and necessary parties to a suit to adjudicate water rights in different community acequias on the same stream. In that case there were some 1,200 or more individual participants, all joined as parties plaintiff or defendant. The rights under that suit have been adjudicated and determined. Suppose that later the court should hold that it was mistaken as to the law in the case, and that the acequia corporation was the owner of the water rights, and that such suit should be instituted by and against such community acequia, could an individual who was made a party in the suit referred to collaterally assail the decree in that case because of a change of view by the court as to the law? Undoubtedly the private individual would be bound by the decree so long as it was not directly attacked. We think in this case the corporation defendant and its officers are bound by the decrees in question so long as such decrees are not directly assailed, and that they aré impervious against collateral attack.
In the ease of Foltz et al. v. St. Louis & S. F. Ry. Co., 60 Fed. 316, 8 C. C. A. 635, a judgment of condemnation of real estate was attacked collaterally; it being the contention of the plaintiff that the railroad company did not have the legal capacity to condemn land. Judge San-born, speaking for the court, said:
“The contention is that it [the judgment of condemnation] is an absolute nullity in this case, because the court entered such a judgment in favor of a corporation which had not that right. Stripped of argument and verbiage, the position is that this judgment is void because the appellee had not legal capacity to sue for it, although there were many parties that had such capacity, in whose favor the circuit court had ample power to enter such a judgment. But the question of the legal capacity of the plaintiff to prosecute condemnation proceedings, like that of the necessity for th.e condemnation, and that of the public or private purpose of it, is a question that the trial court must necessarily hear and determine in every condemnation proceeding. Is every judgment in which the court committed an error in the decision of one of these questions, without the jurisdiction df the court, a nullity, and only those in which it has made no mistake valid? Jurisdiction of the subject-matter is the power to deal with the general abstract question, to hear the particular facts in any case relating to this question, and to determine whether or not they are sufficient to invoke the exercise of that power. It is not confined to cases in which the particular facts constitute a good cause of action, but it includes ever’y issue within the scope of the general power vested in the court by the law of its organization, to deal with the abstract question. Nor is this jurisdiction limited to making correct decisions. It empowei'S the court to determine every issue within the scope of its authority according to its own view of the law and the evidence, whether its decision is right or wrong’, and every judgment or decision so rendered is final and conclusive upon the parties to it, unless reversed by writ of error or appeal, or impeached for fraud. [Cases cited.] Wherever the right and the duty of the court to exercise its jurisdiction depends upon the decision of a question it is invested with power to hear and determine, there its judgment, right or wrong, is impregnable to collateral attack, unless impeached for fraud.”
[3] But from the foregoing it does not follow that the cause must be reversed. There were other grounds of objection stated to the complaint, one of which was that the petition failed to show that the respondents or either of them were bound by either of said decrees. It is well settled that where a ground of demurrer to a complaint should have been sustained, the decree sustaining the demurrer, though on another and insufficient ground, will be affirmed. Gaynor v. Bauer, 144 Ala. 448, 39 South. 749, 3 L. R. A. (N. S.) 1082; Porter v. Plymouth, etc., 29 Mont. 347, 74 Pac. 938, 101 Am. St. Rep. 569; British-American Insurance Co. v. Wilson, 77 Conn. 559, 60 Atl. 293; Crittenden v. Southern Home, Building & Loan Ass’n, 111 Ga. 266, 36 S. E. 643; Birmingham v. Cheetham, 19 Wash. 657, 54 Pac. 37.
[3] The complaint in the present case fails to show that the appellees were parties to either of the original suits, or that they were the servants, agents, or in any manner in privity with the original parties. The Acequia Nueva and its officers were enjoined from diverting water, and the petition in the present action shows that appellees had diverted water from the Eio de Nambe into a certain ditch known as the Acequia de los Garduños and other acequias or ditches inferior in right to the seven incorporated ditches. There is no showing that any of the acequias mentioned was included in the decree of injunction, or was in any manner parties to the proceeding, or that either of the appellees was a party. A stranger to a cause who is unconnected with the parties defendant will not be punished for doing the act prohibited by the injunction. High on Injunction, § 1435; Boyd v. State, 19 Neb. 128, 26 N. W. 925.
For this reason we think the demurrer should have been sustained, and the judgment of the lower court will therefore be affirmed; and it is so ordered.
Parker, C. J. and Baynolds, J., concur.