
420 F.Supp. 882 (1976)
Georgia WHITE, as guardian ad litem for Florence Red Dog, an incompetent person
v.
David MATTHEWS, etc., et al.
Richard KNEIP, etc., et al.,
v.
OGLALA SIOUX TRIBE OF the PINE RIDGE RESERVATION, SOUTH DAKOTA.
No. CIV 76-5031.
United States District Court, D. South Dakota.
October 5, 1976.
*883 Anita Remerowski, Mary Ellen Sloan, Legal Services, Mission, S. D., for plaintiff.
William F. Clayton, U. S. Atty., Sioux Falls, S. D., Thomas E. Stuen, Dept. of Justice, Washington, D. C., William Janklow, Atty. Gen., Charles L. Dorothy, Asst. Atty. Gen., State of South Dakota, Pierre, S. D., for defendant.

MEMORANDUM OPINION
BOGUE, District Judge.

I

INTRODUCTION
On April 15, 1976, Georgia White petitioned this Federal District Court to appoint *884 her as Guardian Ad Litem for her sister Florence Red Dog whom the Oglala Sioux Tribal Court had found to be mentally ill and in need of immediate commitment for the protection of herself and others. Because it appeared that such appointment was necessary, and it further appeared that Georgia White was a suitable and proper person, the appointment was made. On April 15, 1976 Georgia White, as Guardian Ad Litem for Florence Red Dog, by her counsel filed a complaint which in relevant part alleged: that Florence Red Dog was in a dangerously mentally ill condition and had threatened and physically attacked other persons and attempted suicide; that she was as of April 15 incarcerated in the Pine Ridge tribal jail, was heavily sedated and all her clothing had been taken away to prevent suicide attempts; that state officials had refused to act in accordance with state law to provide necessary emergency medical treatment; and that such refusal was violative of equal protection as guaranteed by the Fourteenth Amendment. A declaratory judgment and immediate injunctive relief were sought. This Court entered a Temporary Restraining Order wherein state officials were ordered to stop persisting in their refusal to commit Florence Red Dog to the Human Services center in Yankton pending a final decision in this matter.
On April 19, 1976 Georgia White (hereinafter Plaintiff) by her attorney filed an Amended Complaint. The cause of action against the state officials was restated and certain federal officials were also named as defendants. As a cause of action against the federal officials plaintiff alleged in relevant part: that these federal officials have a legal duty to provide mental health care for Indian persons; that said officials had refused to carry out their duty to provide health care; and that such refusal had caused Florence Red Dog personal damages in the amount of $100,000.00.
On May 5, 1976, plaintiff filed a Second Amended Complaint. In addition to a change in the caption correcting an error as to the identity of a public official named as a defendant, this complaint rearranged the claims of plaintiff and set out with greater clarity the theories advanced in the first amended complaint.
In plain and simple terms plaintiff's claim could be reduced to one assertion; namely, that either state or federal officials, or both, have a legal duty to provide medical care for the mentally ill Indian woman for whom plaintiff was appointed Guardian Ad Litem.
State defendants by an Assistant Attorney General filed an answer, cross claim and third party complaint on June 10, 1976. The state defendants did not contest jurisdiction but did raise as a defense the theory that plaintiff had stated no grounds for relief. State defendants specifically asserted that federal law and treaties required South Dakota to treat Indian persons residing on the Pine Ridge Indian Reservation differently than other South Dakota citizens living off of the reservation and that federal law, and treaties precluded South Dakota from assuming jurisdiction over the subject matter of the commitment of a mentally ill Indian person residing on the Pine Ridge Reservation.
In the cross claim against federal officials and third party complaint against the tribe, state officials alleged that either the Oglala Sioux Tribe or the Federal Government was legally responsible for the mental health care of Florence Red Dog. Accordingly, they prayed inter alia for the following relief: that plaintiff's action against state officials be dismissed; that state officials' refusal to give treatment be declared not violative of equal protection; that Florence Red Dog be committed to St. Elizabeth's Hospital in Washington, D. C.; and finally that either the federal defendants or the tribe be declared liable for costs and services provided Florence Red Dog.
On June 24, 1976, the federal defendants filed an answer to the plaintiff's Second Amended Complaint and filed a cross claim against the state defendants. The federal defendants admitted that Florence Red Dog, as of April 15, was mentally ill and was a danger to herself and others but *885 denied that any federal officials had a duty to provide relief. They further raised, inter alia, the following defenses: lack of subject matter jurisdiction and failure to state a claim upon which relief could be granted.
Further, the federal defendants cross claimed against the state defendants seeking declaratory and injunctive relief. Particularly, the federal defendants asked this Court to declare that the South Dakota officials had adopted and implemented procedures which had the purpose and effect of preventing the mental health treatment of American Indian residents of the state on the same basis as non-Indian residents thereby violating the due process and equal protection clauses of the Fourteenth Amendment as well as Title 27 of the South Dakota Compiled Laws; as injunctive relief these defendants sought, of course, to enjoin the continuation of the allegedly unlawful practices.
On July 9, 1976 state defendants answered federal defendants' cross claim in substance in the same manner they had answered the Second Amended Complaint; i. e. federal law and treaties required that South Dakota treat Indian persons residing on the reservation differently than other South Dakota citizens living off the reservation. Thus they sought dismissal of the cross claim and a declaration that state officials' actions were proper.
The federal defendants moved this Court to dismiss the state defendants' cross claim for lack of jurisdiction and failure to state a claim.
The Oglala Sioux Tribe moved for dismissal of the third party suit against it for lack of jurisdiction, for failure to allege a violation of any person's rights by the tribe, and because of sovereign immunity.
After the pleadings were at this stage, all parties provided briefs on various points of law, and the Court set a hearing date for argument on the several motions before it. Before the hearing date, the state defendants moved for leave to amend their answer to the federal defendants' cross claim to include a counterclaim. In addition, a struggle over the propriety of discovery by state officials of federal defendants' materials added significantly in this intervening period to the burgeoning file.
On September 15, 1976, this matter came on for hearing in the Federal Courthouse in Rapid City. All parties agreed that no facts were in dispute; and everything to be decided was admittedly a matter of law. It was further agreed that the salient points of law could be covered by concentrating upon the following: (1) the tribe's motion to dismiss; (2) the federal defendants' motion to dismiss the state defendants' cross claim; and (3) the state defendants' motion for leave to amend its answer to the federal defendants' cross claim. The arguments were heard; the tribe's motion to dismiss was granted; and ruling as to the other motions was reserved.

II

JURISDICTION
In her Second Amended Complaint plaintiff is suing two distinct groups of persons, i. e., federal officials and state officials. There must be an independent jurisdictional basis for each group as pendent parties are not generally embraced within the doctrine of pendent jurisdiction. Vol. 13, Wright-Miller-Cooper, Federal Practice and Procedure, § 3567 (1975).

A. THE STATE DEFENDANTS
Jurisdiction over the subject matter of the suit against the state defendants is predicated on 28 U.S.C. § 1343(3) and (4). The complaint plainly states that the federal right allegedly violated by state defendants is the right to equal protection of the laws guaranteed by the Fourteenth Amendment. Hence, it appears that the applicable subsection is § 1343(3) which provides:
The district courts shall have original jurisdiction in any civil action authorized by law to be commenced by any person: . . .
(3) To redress the deprivation, under color of any State law, statute, ordinance, regulation, custom or usage, of any right, *886 privilege or immunity secured by the Constitution of the United States or by any Act of Congress providing for equal rights of citizens or of all persons within the jurisdiction of the United States.
One prerequisite for jurisdiction under this subsection is action "under color of" state law, statute, ordinance, etc. The parties have not raised the issue, but the Court thinks this jurisdictional element needs some examination in this case. The state officials who refused to commit Florence Red Dog made their refusal, not because state law forbade commitment, but rather because they believed federal law precluded state intervention in the matter. Therefore, although the initial refusal to commit Florence Red Dog for treatment in a state facility was made in an official capacity, it was not made on the basis of any state law nor did plaintiff so allege. Thus, upon reflection, we are forced to consider the meaning of the phrase "under color of state law." Two possibilities exist; the phrase could refer to officials' actions even though the officials are not purporting to enforce state law, or the phrase could be limited to "state action" wherein a specific state law, statute, ordinance, custom, regulation or usage is being enforced allegedly in violation of a federal right.
Similar questions have been faced before. In Stinson v. Finch, 317 F.Supp. 581 (N.D. Ga.1970) a district court held that 28 U.S.C. § 1343(3) conferred no jurisdiction when state officials implemented policies required by a federal statute; in other words, there was no action "under color of state law" when the state action which was challenged was undertaken pursuant to a federal statute. In Ayala v. District 60 School Board of Pueblo, Colorado, 327 F.Supp. 980 (D.Colo.1971), a district court construed the words "under color of state law" differently. The district court in Colorado stated:
It is settled that the phrase "under color of" comprehends all official behavior, even that which is patently unlawful under state, as well as federal, law.
This Court agrees with the reasoning of the latter case, and finds that the South Dakota officials being sued by plaintiff were acting "under color of state law" when they refused Florence Red Dog treatment by virtue of the fact that they were acting within the scope of their duties as state officials; the fact that they did not rely upon a specific South Dakota law but rather acted in the belief that federal law precluded the requested action does not convert their actions into something other than actions "under color of state law."
As the Ayala decision noted, this view of 28 U.S.C. § 1343(3) derives from Monroe v. Pape, 365 U.S. 167, 81 S.Ct. 473, 5 L.Ed.2d 492 (1961). In that case the Supreme Court decided, after a careful and detailed examination of the history of the key phrase, that officials' actions were "under color of state law" even when the actions were taken in violation of, rather than pursuant to, state law. Now, if official actions in violation of state law can be "under color of state law" for purposes of § 1343(3), then surely actions of state officials which are not required by state law can also be "under color of state law" by virtue of the official nature of the action taken.
In short, we conclude that jurisdiction over the subject matter of the claims against the state defendants is conferred by 28 U.S.C. § 1343(3). As to these claims no jurisdictional account is required; hence, the Court can proceed to the merits.

B. THE FEDERAL DEFENDANTS
Plaintiff asserts that this Court has jurisdiction over the subject matter involving the federal defendants on three different bases: (1) 28 U.S.C. § 1331, (2) 28 U.S.C. § 1361, and (3) 5 U.S.C. § 706. The federal defendants have contested this Court's jurisdiction over the subject matter of plaintiff's suit. We find jurisdiction is rightly predicated on any one of the three statutes, supra, and will examine each briefly.
1. 28 U.S.C. § 1331 (Federal Question).
In the familiar language of § 1331(a): The district courts shall have original jurisdiction of all civil actions wherein the *887 matter in controversy exceeds the sum or value of $10,000, exclusive of interests and costs, and arises under the Constitution, laws, or treaties of the United States.
After a long and not entirely consistent history, this section has been generally held to mean that a federal question for jurisdictional purposes exists when federal law creates a substantive right which a plaintiff seeks to enforce. See Vol. 13, Wright-Miller-Cooper, Federal Practice and Procedure, § 3562 (1975).
Moreover, the "laws" referred to in § 1331 include federal common law as well as statutory law. The Supreme Court in examining the breadth of the federal question doctrine recently stated in Illinois v. City of Milwaukee, Wisconsin, 406 U.S. 91, 92 S.Ct. 1385, 31 L.Ed.2d 712 (1972):
We see no reason not to give "laws" its natural meaning . . . and therefore conclude that § 1331 jurisdiction will support claims founded upon federal common law as well as those of a statutory origin.
This doctrine is particularly significant when considered in relation to Indian tribes and individuals; Indian "rights" have been recognized during the long history of dealings between the federal government and Indians; and these rights are often not so explicit in statutes and treaties as in judicial opinions. Thus, the rights extended by federal law must be gleaned from a reading of case law which has long defined and continues to define the rights of tribes and Indian individuals vis-a-vis the federal government. The Supreme Court has recently recognized and developed this theory of "federal question" jurisdiction based upon case law relating to Indians and Indian tribes. Oneida Indian Nation of New York State v. County of Oneida, New York, 414 U.S. 661, 94 S.Ct. 772, 39 L.Ed.2d 73 (1974). Therefore, if plaintiff states a claim arising under the Constitution, a treaty, statutory law or federal common law, a federal question is presented.
Plaintiff makes reference to the Sioux Treaty of 1868 (15 Stat. 635). In Article 13 of that treaty the government agreed to furnish for the Indians "the physician" on an annual basis, and in Article 4 agreed to provide a "residence for the physician." Apparently, only one physician was contemplated by the treaty makers; moreover, the United States in Article 9 explicitly reserved the privilege of withdrawing the physician after ten years. It would take a very tortured reading of the 1868 Treaty to find therein an obligation of the federal government to provide mental health care for Florence Red Dog; accordingly, the Court rejects that theory as a jurisdictional base and will examine other theories on the face of the complaint as they appear to have some merit.
(a) Statutory law: plaintiff first relies on 42 U.S.C. § 2001 and 25 U.S.C. § 13 as statutes which create a duty whereby defendant federal officials must provide health care for Indian persons, specifically inpatient mental care facilities, or alternatively monies for contracting with state or local health care facilities. These allegations do indeed present a federal question; a substantive right is alleged to be extended by these federal laws and the conflict cannot be resolved without a construction of these federal statutes. Furthermore, the question raised is substantial, i. e. it is by no means clear from precedent that the construction of these statutes sought by plaintiff is foreclosed. On this basis alone, we think federal jurisdiction is properly invoked.
(b) The "trust responsibility": More compelling than the cites to certain federal statutes is plaintiff's well-pleaded reliance upon the "trust responsibility." It cannot be disputed that the history of the federal government's dealings with the Indian nations has resulted in the creation of a unique legal relationship between reservation Indians and the federal government. The dimensions of this relationship are outlined in case law dating back to the early days of the republic. Plaintiff now alleges that one facet of the Indian-government relationship is the duty assumed by the government to care for persons in the class of plaintiff's ward.
*888 We consider this simple allegation a sound basis for invoking federal jurisdiction. Plaintiff is in essence raising the issue of whether or not a duty has been created by federal common law toward Florence Red Dog for her care and protection in a time of severe mental illness. On the authority of the Oneida case, supra, we think that portion of the pleading raises a substantial federal question for jurisdictional purposes.
(c) Plaintiff's claim that the due process clause of the Fifth Amendment has been violated by arbitrary and unreasonable bureaucratic actions toward Florence Red Dog is arguably a possibility for a jurisdictional basis in this case. Without denying this possibility, we say merely that the references to statutes and the trust responsibility make more sense to the Court at this time, and we do not predicate jurisdiction on the theory that a right extended by the due process clause may have been violated.
Section 1331 does, of course, require that the jurisdictional prerequisite of a $10,000 dispute be present. Damages to Florence Red Dog in the sum of $100,000.00 are alleged.
This Court, therefore, holds that the plaintiff's well-pleaded complaint contains allegations which are sufficient to invoke federal jurisdiction on the basis of 28 U.S.C. § 1331.
2. 5 U.S.C. § 706 (The Administrative Procedure Act).
Although not all courts and commentators are in agreement that § 706 of the A.P.A. is itself a grant of jurisdiction, we follow the cases which hold that the A.P.A. is a jurisdictional grant. E. g. Sioux Valley Empire Elec. Ass'n, Inc. v. Butz, 367 F.Supp. 686 (D.C.S.D.1973), affirmed 504 F.2d 168 (8th Cir. 1974); and Aleut League v. Atomic Energy Commission, 337 F.Supp. 534 (D.C.Alaska, 1971). Therefore, if the jurisdiction under 28 U.S.C. § 1331 were not present, we would find jurisdiction under the A.P.A. for the reason that the complaint seeks review of decisions made by employees of the Indian Health Service, an administrative agency.
3. 28 U.S.C. § 1361 (Mandamus).
According to this statute:
The district courts shall have original jurisdiction of any action in the nature of mandamus to compel an officer or employee of the United States or any agency thereof to perform a duty owed to the plaintiff.
As a matter of law this statute does not grant jurisdiction when the duty allegedly owed is the performance of a discretionary act rather than a ministerial act. Ortego v. Weinberger, 516 F.2d 1005 (5th Cir. 1975). Nevertheless, the fact that a duty becomes clear only after construction of a statute, does not preclude relief under this section. Carey v. Local Bd. No. 2, Hartford, Conn., 297 F.Supp. 252 (D.C.Conn. 1969), affirmed 412 F.2d 71 (2nd Cir. 1969).
At the time this suit was commenced, it was by no means clear that federal officials were ignoring a ministerial duty; in fact, the core of their defense is that the mental health care for the woman in question is entirely a discretionary matter as far as federal officials are concerned.
Yet, the substance of plaintiff's complaint is that a nondiscretionary duty to provide care is owed. It is the opinion of this Court that this is sufficient for jurisdiction under § 1361. For jurisdictional purposes it is not necessary that the duty be clear before the analysis begins; in other words, we take jurisdiction to determine whether there is a duty owed.
Moreover, this section granting jurisdiction to issue writs of mandamus is flexible and can also encompass declaratory relief if this remedy is deemed proper. Brown v. Schlesinger, 365 F.Supp. 1204 (E.D.Va. 1973). There is no inconsistency in asking for mandamus in conjunction with declaratory relief. If other bases were inadequate, we would take jurisdiction under this section.

III

MOTIONS BEFORE THE COURT
Having considered the jurisdictional questions in relation to the original suit, *889 and being fully aware that the case is not yet in a posture for a decision on the merits, it is this Court's opinion that a timely ruling on the two motions now pending can serve to clarify the positions of each of the parties and thereby will tend to move this case toward a speedy resolution. The two motions now pending are: (1) the federal defendants' motion to dismiss the state defendants' cross claim, and (2) the state defendants' motion for leave to amend their answer to the federal defendants' cross claim.

IV

FEDERAL DEFENDANTS' MOTION TO DISMISS STATE DEFENDANTS' CROSS CLAIM

A. Jurisdiction

The federal defendants first contend that the Court has no subject matter jurisdiction over the state defendants' cross claim. We think the rule is clear that federal courts have jurisdiction over cross claims under the ancillary jurisdiction concept. See, Vol. 13, Wright-Miller-Cooper, Federal Practice & Procedure, § 3523 (1975) and Vol. 6, Wright & Miller, § 1433 (1971); Dow Corning Corp. v. Schpak, 65 F.R.D. 71 (N.D.Ill. 1971); Coastal Airlines, Inc. v. Dockery, 180 F.2d 874 (8th Cir. 1950).
Once the federal court has jurisdiction of the principal action, it may hear any ancillary proceeding without regard for any factors that would normally be determinative of subject matter jurisdiction with the qualification that cross claims are subject to the same transactional test as compulsory counter-claims. In this case all claims presented in the state's cross claim arise from the occurrence that is the subject matter of the original action.[1] Therefore, this Court takes jurisdiction over the state defendants' cross claim. On the same basis the Court assumes jurisdiction over the federal defendants' cross claim against the state defendants.

B. Standing

Federal defendants vigorously contend that the cross claim of the state defendants ought to be dismissed as the state defendants in the original suit have no standing to sue on the cross claim. Standing, of course, is a judicially-created doctrine of great flexibility designed to insure that a conflict capable of judicial resolution is presented to the Court. Vol. 13, Wright-Miller-Cooper, supra, § 3531 (1975). Though the doctrine has created much uncertainty for various types of potential plaintiffs, the basic qualification, i. e. that the plaintiff have a "personal stake in the outcome" is a qualification designed to insure that truly adverse legal interests rather than hypothetical legal questions are presented. Assuming, without deciding, that the standing doctrine is applicable to parties advancing cross claims, we find no policy that the standing doctrine is designed to advance being thwarted by the Court's taking cognizance of the cross claim in this particular case. We reject the theory that the standing doctrine requires dismissal of the cross claim.

C. Failure to state a claim

Federal defendants assert that the cross claim against them fails to state any claim upon which relief can be granted. This assertion, whether leveled against the state defendants or the plaintiff, takes us to the heart of the lawsuit. The legal questions are complex and it is quite possible some fact-finding needs to be accomplished before the Court can get a comprehensive view of the merits.
Nevertheless, looking at the state defendants' cross claim in its entirety, we cannot say as a matter of law that no legal claim is stated. We have read with great care the recent case construing the Snyder Act (25 U.S.C. § 13), and note that in the particular circumstances of that case the government *890 was not successful in convincing the Supreme Court that the B.I.A. had discretion to pay or not to pay economic assistance benefits to certain unemployed Indian persons living off of the reservation. Morton v. Ruiz, 415 U.S. 199, 94 S.Ct. 1055, 39 L.Ed.2d 270 (1974). Although the basis of the claim in this instance is somewhat different, we think that the Snyder Act needs to be carefully reviewed in light of the Morton case. Until the question of duty is answered with regard to the federal defendants, we think the dismissal of the state defendants' cross claim would be premature at best. Thus, the motion to dismiss the cross claim will be denied.

V

STATE DEFENDANTS' MOTION FOR LEAVE TO AMEND THEIR ANSWER TO THE FEDERAL DEFENDANTS' COUNTERCLAIM
Under F.R.C.P. 7(a) and 13(a) it is plain that an answer to a cross claim may contain a counterclaim, and shall state as a counterclaim any claim which the pleader has against the opposing party. State defendants had filed their cross claim prior to the time the federal government cross claimed against them; presumably, state defendants now seek to incorporate into their answer to the federal defendants' cross claim the substance of their own prior cross claim. This Court finds that the amendment could simplify the pleadings and finds no reason why the leave to amend should not be granted.

VI

SUMMARY
This Court has been concerned during the progress of this case with one single question: which governmental entity must pay for the treatment of one indigent mentally ill reservation woman? This Court has stated on the record that either South Dakota or the Government of the United States through one agency or another will pay. Up to this point the federal defendants have resisted discovery by state defendants on the ground that the federal defendants, as a matter of law, had no duty toward Florence Red Dog. We have decided that the law is not so clear as to require dismissal of the state's cross claim, and assume that this is sufficient to indicate that discovery by state defendants, if necessary, must proceed in order to assure a just and timely resolution on the merits.
NOTES
[1]  The state defendants in one paragraph of their answer and cross claim (para. 26) cite past expenditures for indigent Indian persons; however, they seek no specific relief at this time other than declaratory and injunctive relief in regard to one occurrence, i. e. the treatment of Florence Red Dog.
