In plaintiffs’ suit for equitable relief, declaratory relief and money damages because defendants allegedly were violating plaintiffs’ first and fourteenth amendment rights by prosecuting them and by suppressing the prosecution of others, the district court granted motions to dismiss in favor of Franchot A. Brown and John Foard, Magistrate and Solicitor, respectively, for the County of Rich-land, South Carolina. The district court ruled that both defendants were immune from suit since the actions complained of concerned the exercise of their respective judicial and quasi-judicial immunity. After entry of an order certifying the dismissal as a final judgment, Rule 54(b), F.R.Civ.P., this appeal followed.
Although Brown and Foard are immune from suit for money damages, we hold that they are not immune from equitable and declaratory relief. Contrary to the arguments of these defendants, we also conclude that plaintiffs have alleged a cause of action which survives the restrictive rule of Younger v. Harris, 401 U.S. 37, 91 S.Ct. 746, 27 L.Ed.2d 669 (1971). Accordingly, we conclude that dismissal as to Brown and Foard was erroneously granted. We reverse and remand for further proceedings.
I.
For purposes of this appeal, we accept, as we must, the facts as alleged in the complaint. It sets forth that plaintiffs are prisoners incarcerated at the Central Correctional Institution at Columbia, South Carolina.1 On August 11, 1973, plaintiff Timmerman, falsely accused of being under the influence of alcohol, was brutally assaulted and then handcuffed by certain of the defendant correctional officers of Central. While helpless to defend himself, he was further brutally and maliciously battered by these defendants. Plaintiff Thomas and several other inmates attempted to protect Tim-merman from further injury, and as a result of their efforts the beating was discontinued and both plaintiffs were returned to their cells. Although Timmerman suffered multiple physical injuries apparent to anyone observing him, he was denied medical treatment.
Although it is not alleged that Brown and Foard participated in the beating or denial of medical treatment, they were fully informed of the facts. Nonetheless, they conspired to deprive plaintiffs of their right to have access to criminal process to effect punishment on those who committed wrongs on them and their right to speak and write about the *813wrongs perpetrated upon them. Knowing that plaintiffs wished to bring criminal charges against their attackers, Brown, Foard, their co-conspirators and their agents, transferred plaintiffs to solitary confinement where they are still held. Plaintiffs, nevertheless, caused to be delivered to Magistrate Brown proposed criminal warrants against Timmerman’s attackers, charging them with assault and battery, and Magistrate Brown determined that probable cause existed for the issuance of the warrants.
Foard, his co-conspirators and their agents, prevented the issuance of the warrants, however, by notifying Magistrate Brown that inmates could not cause warrants to be brought against correctional officials unless Solicitor Foard determined, on the basis of an independent investigation by the South Carolina Law Enforcement Division (S.L. E.D.), that probable cause existed for their issuance. As a result, Brown refused to issue the arrest warrants. Foard did not cause a S.L.E.D. investigation to be made.2
Plaintiffs also allege that they have been maliciously subjected to threats to their lives and safety, denial of parole to Timmerman, and to bad faith criminal charges. They allege that, even though Magistrate Brown dismissed some of the criminal charges against them, they have been indicted, at the instance of Foard, by the grand jury of Richland County for the same, or substantially the same, offenses which Magistrate Brown dismissed. By affidavits which were supplied us in motions relating to this appeal, -we were advised that by error these indictments have been nol prossed. This aspect of the case is not moot, however, because we are further advised that the state does not intend to give up prosecution of plaintiffs for their part in the incident occurring August 11, 1973. New indictments will be prepared and these indictments will be presented to the grand jury for Richland County which will convene on August 25, 1975.
In summary, plaintiffs allege that defendants, collectively, in violation of 42 U.S.C. §§ 1983 and 1985, are acting in concert, under color of state law, to deprive plaintiffs individually and as a class of their first and fourteenth amendment rights by abusing plaintiffs without provocation, denying plaintiff Timmerman necessary medical treatment, maliciously and in bad faith causing the issuance of warrants for the arrest and prosecution of plaintiffs, and refusing to allow the issuance of criminal warrants against Timmerman’s attackers even though probable cause for their issuance has been found.3 Plaintiffs therefore sought (a) money damages, (b) a declaration that the espoused policy of Foard to suppress criminal warrants based on probable cause and issued at the instance of inmates of a correctional institution violates the fourteenth amendment, (c) an injunction against defendants, except Magistrate Brown, to restrain them from interfering with the issuance or nonissuance of criminal warrants, (d) an injunction to restrain the pending criminal prosecutions against Timmerman and Thomas, and (e) a writ, of mandamus requiring Magistrate Brown to issue the criminal warrants against Timmerman’s attackers.
II.
We agree with the district court that, on the basis of judicial immunity, the *814complaint against Brown and Foard should be dismissed to the extent, but only to the extent, that it seeks the recovery of money damages. Brown, as a judicial officer, and Foard, as a prosecutor, enjoyed judicial and quasi-judicial immunity, respectively. Pierson v. Ray, 386 U.S. 547, 87 S.Ct. 1213, 18 L.Ed.2d 288 (1967); McCray v. Maryland, 456 F.2d 1 (4 Cir. 1972). This immunity, however, protects qualified defendants only from claims for money damages. It “does not extend to plaintiff’s action for injunctive and declaratory relief under Section 1983, 42 U.S.C.” Fowler v. Alexander, 478 F.2d 694, 696 (4 Cir. 1973). See Littleton v. Berbling, 468 F.2d 389 (7 Cir. 1972), cert. den., 414 U.S. 1143, 94 S.Ct. 894, 38 L.Ed.2d 674 (1974), rev’d on other grounds sub nom. O’Shea v. Littleton, 414 U.S. 488, 94 S.Ct. 669, 38 L.Ed.2d 674 (1974), vacated sub nom., Spomer v. Littleton, 414 U.S. 514, 94 S.Ct. 685, 38 L.Ed.2d 694 (1974). See also Mitchum v. Foster, 407 U.S. 225, 92 S.Ct. 2151, 32 L.Ed.2d 705 (1972), where, as here, in a suit against a state prosecuting attorney and circuit judge, the Supreme Court concluded that 42 U.S.C. § 1983 is an “expressly authorized” exception to the federal anti-injunction statute, 28 U.S.C. § 2283.
We conclude, then, that the district court overextended the doctrine of judicial immunity insofar as it applied it to warrant dismissing Brown and Foard from those aspects of the complaint which sought declaratory and injunctive relief. Unless there is some jurisdictional bar, Brown and Foard should be retained as parties defendant in the action and the case decided on the merits.
III.
Before us, Brown and Foard urge the holdings in Younger v. Harris, 401 U.S. 37, 91 S.Ct. 746, 27 L.Ed.2d 669 (1971), and its progeny as an additional ground why they should be dismissed. Their argument is that under Younger the district court lacked jurisdiction, or at least should have abstained from exercising jurisdiction, with respect to the prayer that pending prosecutions against plaintiffs be enjoined. They contend also that, since plaintiffs’ prayers for other relief revolve so intimately around South Carolina’s criminal law enforcement policy, jurisdiction should not exist as to them or that jurisdiction should not be exercised. We are not persuaded. We think that the allegations in this case put it squarely within one of the exceptions recognized in Younger where it is proper for a federal court to restrain a state criminal prosecution. If jurisdiction to determine whether to grant such extraordinary relief exists and may be exercised, it follows that jurisdiction to decide plaintiffs’ other prayers for declaratory and injunctive relief also exists and may be exercised. Cf. Steffel v. Thompson, 415 U.S. 452, 94 S.Ct. 1209, 39 L.Ed.2d 505 (1974); Hicks v. Miranda, 422 U.S. 332, 95 S.Ct. 2281, 45 L.Ed.2d 223 (1975).
In Dombrowski v. Pfister, 380 U.S. 479, 85 S.Ct. 1116, 14 L.Ed.2d 22 (1965), the Supreme Court affirmed an injunction against a threatened state prosecution based upon a state statute which unconstitutionally inhibited the right of free speech. The possible scope of Dombrowski was sharply restricted, however, in Younger, where it was held that the rule was to the contrary when the state criminal proceeding had already commenced. Nevertheless, in Younger, the Court significantly qualified the anti-injunction rule announced in that case by suggesting possible exceptions:
It is sufficient for purposes of the present case to hold, as we do, that the possible unconstitutionality of a statute “on its face” does not in itself justify an injunction against good-faith attempts to enforce it, and that appellee Harris has failed to make any showing of bad faith, harassment, or any other unusual circumstance that would call for equitable relief. 401 U.S. at 54, 91 S.Ct. at 755.
The holding in Younger has been extended and refined in a number of subsequent cases. For our purposes, it is unnecessary to analyze subsequent hold*815ings except to note that the exceptions to federal nonintervention suggested in Younger have continued to be recognized. In the recent decision in Kugler v. Helfant, 421 U.S. 117, 95 S.Ct. 1524, 44 L.Ed.2d 15 (1975), Younger was approvingly described:
[T]he Court in Younger left room for federal equitable intervention in a state criminal trial where there is a showing of “bad faith” or “harassment” by state officials responsible for the prosecution . . ., where the state law to be applied in the criminal proceeding is “flagrantly and patently violative of express constitutional prohibitions,” ... or where there exist other “extraordinary circumstances in which the necessary irreparable injury can be shown even in the absence of the usual prerequisites of bad faith and harassment.”
Accord: Huffman v. Pursue, Ltd., 420 U.S. 592, 95 S.Ct. 1200, 43 L.Ed.2d 482 (1975); Hicks v. Miranda, 422 U.S. 332, 95 S.Ct. 2281, 45 L.Ed.2d 223 (1975); Doran v. Salem Inn, Inc., 422 U.S. 922, 95 S.Ct. 2561, 45 L.Ed.2d 648 (1975).
We think that in the instant case plaintiffs have alleged a case of “bad faith” or “harassment” by state officials for the prosecution. As pointed out in Kugler, 421 U.S. at 126, n.6, 95 S.Ct. at 1531, “ ‘bad faith’ in this context generally means that a prosecution has been brought without a reasonable expectation of obtaining a valid conviction.” “Harassment” means much the same, although it also connotes a legal exercise of authority in such a manner as to be unnecessarily oppressive.
Plaintiffs have alleged that Magistrate Brown dismissed charges against them but, nevertheless, they have been, or will be indicted by the grand jury and prosecuted on the same or substantially similar charges. While that allegation alone may not reasonably give rise to the inference that there is little likelihood that they will be convicted, plaintiffs have alleged that Magistrate Brown found that there was probable cause to prosecute some of the defendants for their part in the same incident which purportedly gave rise to the charges against plaintiffs. Of course, it is theoretically possible for two participants in an affray between them both to be guilty of assault. But unless we are to assume the incompetence of Brown or a strong bias in favor of plaintiffs — assumptions for which there is no basis in the record — it is less likely that there is a good case against plaintiffs when a disinterested judicial officer has determined that there is no basis on which to prosecute them but there is a basis on which to prosecute their antagonists. Whatever lingering doubt may exist about the substance of any case against plaintiffs is removed, at this stage of the case, by the further allegation that Foard took steps, concededly illegal if in fact taken, to suppress any prosecution of plaintiffs’ antagonists notwithstanding that the Magistrate found probable cause for these prosecutions to go forward.
We have no doubt that plaintiffs, even though they are inmates, have some first and fourteenth amendment rights to air their grievances and to have access to judicial procedures to redress them. Procunier v. Martinez, 416 U.S. 396, 94 S.Ct. 1800, 40 L.Ed.2d 224 (1974); Cruz v. Beto, 405 U.S. 319, 92 S.Ct. 1079, 31 L.Ed.2d 263 (1972); Johnson v. Avery, 393 U.S. 483, 89 S.Ct. 747, 21 L.Ed.2d 718 (1969); Dowd v. United States ex rel. Cook, 340 U.S. 206, 91 S.Ct. 262, 95 L.Ed. 215 (1951); Cochran v. Kansas, 316 U.S. 255, 62 S.Ct. 1068, 86 L.Ed. 1453 (1942); Lane v. Cornell, 434 F.2d 598, 600 (5 Cir. 1970). We think that plaintiffs have alleged bad faith and intentionally harassing efforts to deny these rights, including but not limited to bad faith and harassing efforts to prosecute them. We think that plaintiffs have alleged a case within an exception to the restrictive Younger rule and that the district court not only had jurisdiction to adjudicate their claims for equitable and declaratory relief on the merits, but also should exercise it.
Of course, we reach these conclusions solely on the basis of plaintiffs’ allega*816tions. In the present posture of the case, those allegations are uncontroverted and we think that they require an evidentiary hearing. Until an evidentiary hearing has been held and the facts found, we cannot know them.
It follows that the judgment dismissing Foard and Brown must be reversed and the case remanded for further proceedings not inconsistent with this opinion.
We append two additional comments for the guidance of the district court on remand:
First, it appears from statements contained in affidavits in support of, and in opposition to, a motion for summary reversal that defendant Foard has been succeeded in office by a certain James C. Anders, Esquire. In oral argument, counsel confirmed that Foard is no longer Solicitor for Richland County. A formal substitution of parties has not been requested, and no party has raised any question of the effect, if any, of defendant Foard’s leaving office. See Spomer v. Littleton, 414 U.S. 514, 94 S.Ct. 685, 38 L.Ed.2d 694 (1974). We do not address the question. It may, however, be raised and decided in the district court on remand.
Second, we would suppose that, if after trial, an injunction to prevent further unlawful interference by the Solicitor of the County of Richland (if such be proved) is granted, Magistrate Brown, freed from interference from the Solicitor’s office, would issue any warrants sought by plaintiffs, which he determined were grounded on probable cause, on his own motion without the necessity of an order by the district court. Because of this likelihood we do not consider the authority of a federal court in order to redress a violation of § 1983 to compel performance of a ministerial act by a state judicial officer. Compare Peek v. Mitchell, 419 F.2d 575 (6 Cir. 1970), with McIntire v. Wood, 7 Cranch. 504, 3 L.Ed. 420 (1813); Stern v. South Chester Tube Co., 390 U.S. 606, 88 S.Ct. 1332, 20 L.Ed.2d 177 (1968); Haggard v. State of Tennessee, 421 F.2d 1384 (6 Cir. 1970); Gurley v. Superior Court of Mecklenburg County, 411 F.2d 586 (4 Cir. 1969). See also Note, Mandatory Injunctions as Substituted for Writs of Mandamus in the Federal District Courts: a Study in Procedural Manipulation, 38 Colum.L.Rev. 903, 904 — 05 (1938). We do not dismiss Magistrate Brown now, however, because if plaintiffs prove the case they have alleged and our supposition with regard to Brown is unfounded, the district court will be brought to the question we reserve.
Reversed and remanded.
. Plaintiffs allege that they sue for themselves and ask to sue also for all inmates who are, have been, or will be incarcerated in Columbia, South Carolina. Whether a class action may be maintained and, if so, who are the members of the class are not now issues before us.
. In oral argument, the representative of the Attorney General of South Carolina conceded that the alleged conduct of Foard, if in fact it occurred, would be illegal under state law. Under South Carolina law, the warrants should have issued upon Magistrate Brown’s finding that there was probable cause for their issuance. As the prosecutor, Foard might thereafter nol pros the prosecution, in open court, if he concluded that the state could not prove a case, but he lacked authority to interfere with issuance of the warrants.
. From the specific allegations of the complaint, it seems clear that Brown and Foard were not alleged to be direct actors in the alleged beating and denial of medical treatment. Yet they allegedly had knowledge of them and these events lend significance to their alleged subsequent acts.