Plaintiff filed his affidavit for writ of mandate in this court. The following are the material allegations of fact in the affidavit. The defendant is an Idaho corporation operating and managing the Salmon River Irrigation system, distributing the water of said system to persons holding water rights under it. It was organized by the Twin Falls Salmon River Land & Water Company, the construction or Carey Act company which built the system under contract with the state of Idaho. Plaintiff owns 80 shares of stock of both these companies. He owns as against everybody except the Hnited States government, and is in possession of, and entitled to the possession of, a certain tract of land in the Carey Act segregation known as the Salmon River tract and watered by the irrigation system constructed by the construction company and operated by the defendant. Water has been delivered to him by said company and used upon said land each year from 1913 to the present time. He has agricultural crops growing upon his land and the use of water from the system operated by defendant is necessary for said crops. The defendant has sufficient water available to supply plaintiff the two acre-feet to which he is entitled under his water contract and a system of canals and laterals by which said water can be delivered to the land of plaintiff. Before suit brought, plaintiff tendered to defendant the maintenance charge fixed by defendant for the use of water during the present irrigation season. Defendant has refused to deliver any water. Plaintiff applied for writ of mandate to one of the judges of the eleventh judicial district, in which said land is situated, and he denied such relief. Plaintiff prays for alternative writ of mandate requiring defendant to deliver to him his proportionate share of the water stored in its irrigation system for use upon his land during the present irrigation season up to the amount of 2% acre-feet which is *155the amount called for by his contract. An alternative writ of mandate issued out of this court.
Defendant demurs both generally and specially, also on grounds of nonjoinder of parties, and another action pending.
The points alleged in support of the general demurrer are that it does not appear that the plaintiff’s stock is appurtenant to the lands described in the affidavit; that it does not appear that plaintiff has succeeded to all the rights of the original holder of the stock, or that he has made a valid entry of the land, or that he has paid for his water right. Plaintiff alleges that the stock represents a water right for the land in question and that the water was used for several years on that land. While it is not specifically alleged that the original holder of the stock assigned his rights to the plaintiff, yet ownership in the plaintiff is • sufficiently set out by the allegation that he is the owner of 80 shares of the capital stock of the construction company and of the defendant. If an allegation of an interest in the land were necessary, paragraph 2 of the affidavit would suffice. But the plaintiff might have a valid water right even though the government refused to patent the land upon which the water had been used. Of this matter, and the authorities touching it, more will be said later in discussing the defendant’s answer. It is the settled law of this state that if a settler has a contract with a Carey Act company, uses the water on his land, and tenders the maintenance charges for the current year, the company cannot refuse to deliver the water simply on the ground that he has not paid or tendered the balance of the purchase price. The company’s remedy is to foreclose on the land and water right for failure to pay. (Adams v. Twin Falls etc. Co., 29 Ida. 357, 161 Pac. 322; Parrott v. Twin Falls etc. Co., 32 Ida. 759, 188 Pac. 451.) Defendant also demurs specially on the ground that the affidavit for the writ is ambiguous and uncertain in certain particulars. We conclude that this ground of demurrer is not well founded. Defendant also *156demurs on the ground that there is a defect of parties defendant in that it appears from the affidavit that the construction company, other water users under the project, and the original holder of plaintiff’s contract have an interest in the controversy and should be made parties. No such interest of any such parties appears on the face of the complaint. Finally, defendant demurs on the ground that there is another action pending between the same parties for the same cause. This is ground of demurrer only when it appears on the face of the complaint. (C. S., see. 6689.) It does not so appear in the affidavit. We conclude that the defendant’s demurrer to the plaintiff’s affidavit should be and it is overruled.
In its answer the defendant makes the following admissions: It is the holding or operating company operating and managing the Carey Act irrigation system constructed by the Twin Falls Salmon Biver Land & Water Company-under contract with the state of Idaho. It has an adequate system of canals and laterals to deliver water to the plaintiff’s land. Plaintiff tendered the maintenance fee; defendant declined to accept it, and declines to deliver water to plaintiff. Water is now being delivered as needed to other lands under the irrigation system. Defendant denies that plaintiff owns the land in question, and alleges that it is part of the public domain; that it was once segregated under the Carey Act but that the Secretary of the Interior has decided that it cannot be irrigated from the irrigation system and that patent for it will not issue to the state. Defendant alleges that this land has been relinquished by the state to the United States and is not now part of the land included in and to be watered by said irrigation system. Defendant admits that water was used upon said land from 1913 to the present, but alleges that it was furnished under the belief that the Secretary of the Interior would issue patent therefor. Defendant denies that agricultural crops are growing upon the land. For lack of sufficient information to enable it to answer the allegation that there is now *157stored in the reservoir and irrigation system sufficient water for irrigation of lands entitled to use water therefrom during the year 1921, defendant denies that allegation. Since the reservoir and irrigation system are being operated by the defendant such a denial is manifestly insufficient.
For an affirmative defense, designated as the second defense, the defendant makes the allegations which follow. The original Carey Act segregation under the defendant’s system comprised 127,000 acres of land. It was ultimately discovered that the amount of water available for said irrigation system was wholly insufficient to reclaim all of said lands. The Secretary of the Interior and the commissioner of the general land office determined that the water available was sufficient to reclaim only about 35,000 net irrigable acres of land and that out of the lands segregated only a gross acreage of approximately 39,000 acres should be patented to the state of Idaho and its assigns. The state of Idaho, acting through its board of land commissioners, and the Secretary of the Interior, selected the lands which could be reclaimed and were entitled to patent, and determined that the water supply under said irrigation system should be applied to them. These lands were patented upon the understanding between these officials that all the water available should be used upon them. Plaintiff’s lands are not among those so selected for patent. The state commissioner of reclamation has ordered and directed that the water available should be used exclusively upon the patented lands.
For a third defense defendant makes the allegations which follow. Plaintiff and his predecessors in interest have made no payments upon the purchase price of the water right. Defendant has no lien upon the land which the government has refused to patent. Under its contract with the construction company defendant is not to deliver water to any land if the owner has not paid for the same, or where the purchase price is not secured by a valid lien on the land. Plaintiff made his investment and improvements with notice *158that the Secretary of the Interior would decline to patent it. Defendant contends that to deliver water to the plaintiff under these circumstances would be a fraud upon the other water users whose lands are subject to a lien and upon the United States in that it would take water from the patented lands.
For a fourth defense defendant makes the allegations which follow. In 1914 plaintiff or its predecessors in interest in said land commenced a suit in the district court for Twin Falls county against the construction company and this defendant, which was removed to the United States district court for Idaho, in which, among other things, plaintiff sought to have it decreed that the available water supply should be confined to the lands for which patent has issued, and said suit is still pending.
For a fifth defense defendant makes the allegations which follow. If plaintiff has any water right, it is because of a contract between himself and the construction company. This defendant has no interest in that contract, but is charged with the duty of operating the system and delivering water to the persons entitled to use it. For these reasons defendant contends that the construction company is a necessary party. The water available is not sufficient for plaintiff’s needs and for the needs of the owners of the patented land. It is all claimed by the owners of the patented land and they are necessary and indispensable parties. This action involves the question of the power and control of Carey Act projects by the Secretary of the Interior and the state commissioner of reclamation, and they are necessary parties.
For a sixth defense defendant alleges that the plaintiff commenced an action in the district court for Twin Falls county against this defendant, for a writ of mandate, which raises the same issues as the present action, and which has not been finally determined, but is still pending in said court.
Plaintiff has moved to strike from defendant’s answer the second, third and fifth defenses on the ground that they *159do not constitute, or do not tend to constitute, any defense to the action.
It is the law of this state that if a water user has a clear right to have water delivered to him by a canal company, if he has crops which are in need of such water, and if the canal company has water which can be delivered to him, mandamus is the proper remedy. (Gerber v. Nampa etc. Irr. Dist., 16 Ida. 1, 22, 100 Pac. 80, 88; State v. Twin Falls Canal Co., 21 Ida. 410, 121 Pac. 1039, L. R. A. 1916F, 236; People v. Farmers’ etc. Canal etc. Co., 25 Colo. 202, 54 Pac. 626; Miller v. Imperial Water Co., 156 Cal. 27, 103 Pac. 227, 24 L. R. A., N. S., 372.) On the other hand, if the plaintiffs’ right to the water is not clear but doubtful, mandamus is not the proper remedy and he will be remitted to his suit in equity to establish his title. (Lewis v. Mt. Home etc. Co., 28 Ida. 682, 156 Pac. 419.) Mandamus is not a proper remedy to decide conflicting interests. Therefore, if the other parties mentioned in the answer have rights or interests adverse to those of plaintiff, to protect which they have a right to be heard in this action, mandamus is not the proper remedy. We will discuss these matters as they are raised by the answer and the motion to strike.
Defendant contends that the plaintiff has no right to the delivery of the water. The facts which it sets up in support of this contention in the second defense are, that there is not sufficient water for all the land under the project, that by agreement between the state land board and the Secretary of the Interior, the Secretary patented only 29,-000 acres with the understanding that all of the available water should be used upon it, and that the state commissioner of reclamation has ordered that all the water be used upon the patented land. This is no defense, for the following reasons. Under the contract between the construction company and the water users, as sanctioned by the federal and state governments, the water rights of all the entrymen and contract holders are of equal rank. The construction company in making the appropriation and completing the *160works acted for the settlers and contract holders. (Adams v. Twin Falls etc. Co., 29 Ida. 357, at 373, 161 Pac. 322; State v. Twin Falls etc. Co., 30 Ida. 41, 166 Pac. 220.)
“It was clearly the intention of the legislature, as well as the construction company, that the individual contract holder or settler should be the owner of the water right upon the completion of the construction works.” (Adams v. Twin Falls etc. Co., supra.)
Plaintiff’s contract with the company and the use of the water upon the land, by himself and predecessors, from 1913 to date, vest in him a water right of equal rank with that of any other entryman. (Knowles v. New Sweden Irr. Dist., 16 Ida. 217, at 227, 228, 101 Pac. 81.) The Secretary of the Interior had the power to decide what land should be patented and what should not, but he had no power to divest the plaintiff of his water right. Nor did the State Land Board or State Commissioner of Reclamation have any such power. It is fundamental that no executive officer or board has the power to deprive a party of a vested right to the use of water. (Speer v. Stephenson, 16 Ida. 707, 102 Pac. 365.) To permit this would clearly be depriving him of his property without due process of law. The contention that plaintiff’s water right necessarily fails because the government has refused to patent the land is not sound. One who has appropriated water and beneficially used it has a right to the use of the water independent of his ownership of the land. (Sarret v. Hunter, 32 Ida. 536, 185 Pac. 1072.) An owner of a water right by purchase or original appropriation may sell the water right separate and apart from his land. (Village of Hailey v. Riley, 14 Ida. 481, 95 Pac. 686, 17 L. R. A., N. S., 86; Bennett v. Twin Falls etc. Co., 27 Ida. 643, 150 Pac. 336.) C. S., sec. 3018, providing that water rights to all Carey Act lands shall attach to and become appurtenant to the land as soon as title passes from the United States to the state, does not and cannot have the effect of making the water right an inseparable appurtenance of the land. To give it such effect would be to render *161it unconstitutional. (Bennett v. Twin Falls etc. Co., supra.) It is thus clear that plaintiff has a water right which entitles him to the delivery of water and of which he cannot be divested by the Secretary of the Interior, the State Land Board, or State Commissioner of Reclamation. The second affirmative defense states no ground of defense.
The contention of defendants’ counsel that the federal courts have decided that the Secretary of the Interior and the state officers had the power to divest plaintiff of his water right is not borne out by the decisions. We have been referred to the following decisions: Twin Falls-Oakley Co. v. Martens, 271 Fed. 428; Twin Falls Salmon River etc. Co. v. Davis, 267 Fed. 382; Caldwell v. Twin Falls Salmon River Land & Water Co., 225 Fed. 584 (U. S. Dist. Court for Idaho); same case on appeal to the C. C. A., Twin Falls Salmon River Land etc. Co. v. Caldwell, 242 Fed. 177, 155 C. C. A. 17; same case on second appeal, 272 Fed. 356.
We find nothing in them to uphold this contention of defendant. The upshot of the whole matter' is that, after protracted litigation in the federal court, the proper parties have not been brought before that court to justify its taking jurisdiction of the question as to whether the water can be taken from the unpatented land and applied exclusively to the patented land. In Twin Falls-Oakley Co. v. Martens, supra, the court says:
“Many entrymen upon those lands have improved them, and, at least until after full opportunity is afforded such entrymen for hearing, we are not ready to say that, when they have complied with the law, they are to be put in a position where all the water must go to the patented lands, and that their lands may be rendered useless and their claim of vested rights ignored.”
In Twin Falls Salmon River etc. Co. v. Davis, supra, the circuit court of appeals said:
“The district court refrained from ruling upon the question of the power of the State Board or Department of Interior, over the objection of the settlers upon the excluded *162lands, to reduce the area of the project in the manner proposed, and, until that question directly arises, it should not be decided.”
The next point made by defendant, as outlined in the third affirmative defense, is that the plaintiff has not paid for his water right. This contention is disposed of in Adams v. Twin Falls etc. Co., supra, holding that under the Carey Act contract and the statutes the company cannot refuse to deliver water to one who has paid or tendered the maintenance charge simply on the ground that he has not paid for his water right or any instalment of the purchase price due under the contract, but is remitted to its action to foreclose the entryman’s interest in the land and the water right after default in payment. Defendant argues that this principle ought not to apply to the instant ease because, owing to the fact that the land office has refused to patent the land, and the state of Idaho has relinquished it to the federal government, the company cannot foreclose on the land. (Twin Falls Salmon River etc. Co. v. Davis, 267 Fed. 382.) The answer to this is that the company is not remediless, since it can foreclose on the water right, if the plaintiff is in default under the contract and the law. Since the Secretary of the Interior had no power to divest plaintiff of his right to use the water, the allegation that plaintiff knew, when he made improvements on the land, that the Secretary would not patent the land, is immaterial. It follows that the third affirmative defense states no ground of defense.
As a fourth affirmative defense defendant contends that there is another action pending in the federal court involving the same parties and the same issues as the present action. This tenders a proper issue in abatement.
As a fifth affirmative defense defendant contends that, on the facts set forth in the answer, the construction company, other water users and contract holders under the project, particularly those who own the patented land, and the Secretary of the Interior, members of the State Land Board, *163and State Commissioner of Reclamation, are all necessary parties to this action. The defendant is the representative of the construction company, incorporated by it for the purpose of distributing the water. The attack upon plaintiff’s water right and the claim of adverse interests of the owners of the patented lands are based solely upon the acts of the above-named officials. For reasons set forth above, these official acts cannot have the effect of divesting the plaintiff of any right or of investing the owners of the patented lands with any additional right, so far as the right to the water is concerned. For these reasons the facts set up in the fifth affirmative defense cast no doubt upon the validity of plaintiff’s water right, none of said parties are necessary or proper parties to this action, and mandamus is a proper remedy for plaintiff to invoke, although it would not be if any of said third parties were able to set up facts which, if true, would give them an adverse claim as against the plaintiff and thus tender a bona fide issue as to the plaintiff’s right.
In the sixth affirmative defense defendant sets up that there is another action pending in the district court for Twin Falls county involving the same parties and the same issues as the instant case, which has not been determined, and which is still pending. This presents a proper issue in abatement.
"We express no opinion upon the question, discussed in the oral argument, but not at present before us for decision, as to whether, by condemnation proceedings, or by any other remedy, the owners of the patented land, or an irrigation district formed by them, can acquire the water rights of the owners of the unpatented land. The facts set forth in the second, third and fifth affirmative defenses do not have the legal effect of divesting the plaintiff of the right to the delivery of water, to which the facts set up in the affidavit, at least prima facie, entitle him. (Gerber v. Nampa etc. Irr. Dist., supra.) The only proper issues tendered by the answer, so far as affirmative defenses are concerned, are those *164contained in the fourth and sixth affirmative defenses. As pointed out above, the denial of the allegation that agricultural crops were growing upon plaintiff’s land presents an issue, it being incumbent upon plaintiff to prove that allegation in order to entitle him to the writ of mandate.
The conclusion is that defendant’s demurrer to the plaintiffs’ affidavit is overruled, the plaintiff’s motion to strike from defendant’s answer is sustained. This leaves the ease at issue on the remaining issues, as outlined in this opinion.
Rice, C. J., and Budge, Dunn and Lee, JJ., concur.