delivered the opinion of the Court.
The question presented is whether, in an action brought under 42 U. S. C. § 1983 against a public official whose position might entitle him to qualified immunity, a plaintiff must *636 allege that the official has acted in bad faith in order to state a claim for relief or, alternatively, whether the defendant must plead good faith as an affirmative defense.
I
Petitioner Carlos Rivera Gomez brought this action against respondent, the Superintendent of the Police of the Commonwealth of Puerto Rico, contending that respondent had violated his right to procedural due process by discharging him from employment with the Police Department’s Bureau of Criminal Investigation. 1 Basing jurisdiction on 28 U. S. C. § 1343 (3), 2 petitioner alleged the following facts in his complaint. 3 Petitioner had been employed as an agent with the Puerto Rican police since 1968. In April 1975, he submitted a sworn statement to his supervisor in which he asserted that two other agents had offered false evidence for use in a criminal case under their investigation. As a result of this statement, petitioner was immediately transferred from the Criminal Investigation Corps for the Southern Area to Police Headquarters in San Juan, and a few weeks later to the Police Academy in Gurabo, where he was given no investigative authority. In the meantime respondent ordered an investigation of petitioner’s claims, and the Legal Division of *637 the Police Department concluded that all of petitioner's factual allegations were true.
In April 1976, while still stationed at the Police Academy, petitioner was subpoenaed to give testimony in a criminal case arising out of the evidence that petitioner had alleged to be false. At the trial petitioner, appearing as a defense witness, testified that the evidence was in fact false. As a result of this testimony, criminal charges, filed on the basis of information furnished by respondent, were brought against petitioner for the allegedly unlawful wiretapping pf the agents’ telephones. Respondent suspended petitioner in May 1976 and discharged him without a hearing in July. In October, the District Court of Puerto Rico found no probable cause to believe that petitioner was guilty of the allegedly unlawful wiretapping and, upon appeal by the prosecution, the Superior Court affirmed. Petitioner in turn sought review of his discharge before the Investigation, Prosecution, and Appeals Commission of Puerto Rico, which, after a hearing, revoked the discharge order rendered by respondent and ordered that petitioner be reinstated with backpay.
Based on the foregoing factual allegations, petitioner brought this suit for damages, contending that his discharge violated his right to procedural due process, and that it had caused him anxiety, embarrassment, and injury to his reputation in the community. In his answer, respondent denied a number of petitioner’s allegations of fact and asserted several affirmative defenses. Respondent then moved to dismiss the complaint for failure to state a cause of action, see Fed. Rule Civ. Proc. 12(b)(6), and the District Court granted the motion. Observing that respondent was entitled to qualified immunity for acts done in good faith within the scope of his official duties, it concluded that petitioner was required to plead as part of his claim for relief that, in committing the actions alleged, respondent was motivated by bad faith. The absence of any such allegation, it held, required dismissal of
*638
the complaint. The United States Court of Appeals for the First Circuit affirmed.
We granted certiorari to resolve a conflict among the Courts of Appeals.
5
II
Section 1983 provides a cause of action for “the deprivation of any rights, privileges, or immunities secured by the Constitution and laws” by any person acting “under color of any statute, ordinance, regulation, custom, or usage, of any State or Territory.” 42 U. S. C. § 1983.
6
This statute, enacted to aid in “ The preservation of human liberty and human rights,’ ”
Owen
v.
City of Independence,
In certain limited circumstances, we have held that public officers are entitled to a qualified immunity from damages liability under § 1983. This conclusion has been based on an unwillingness to infer from legislative silence a congressional intention to abrogate immunities that were both “well established at common law” and “compatible with the purposes of the Civil Rights Act.”
Nothing in the language or legislative history of § 1983,
*640
however, suggests that in an action brought against a public official whose position might entitle him to immunity if he acted in good faith, a plaintiff must allege bad faith in order to state a claim for relief. By the plain terms of § 1983, two — and only two — allegations are required in order to state a cause of action under that statute. First, the plaintiff must allege that some person has deprived him of a federal right. Second, he must allege that the person who has deprived him of that right acted under color of state or territorial law. See
Monroe
v.
Pape,
Moreover, this Court has never indicated that qualified immunity is relevant to the existence of the plaintiff’s cause of action; instead we have described it as a defense available to the official in question. See
Procunier
v.
Navarette, supra,
at 562;
Pierson
v.
Ray, supra,
at 556, 557;
Butz
v.
Economou,
Our conclusion as to the allocation of the burden of pleading is supported by the nature of the qualified immunity *641 defense. As our decisions make clear, whether such immunity has been established depends on facts peculiarly within the knowledge and control of the defendant. Thus we have stated that “[i]t is the existence of reasonable grounds for the belief formed at the time and in light of all the circumstances, coupled with good-faith belief, that affords a basis for qualified immunity of executive officers for acts performed in the course of official conduct.” Scheuer v. Rhodes, supra, at 247-248. The applicable test focuses not only on whether the official has an objectively reasonable basis for that belief, but also on whether “[t]he official himself [is] acting sincerely and with a belief that he is doing right,” Wood v. Strickland, supra, at 321. There may be no way for a plaintiff to know in advance whether the official has such a belief or, indeed, whether he will even claim that he does. The existence of a subjective belief will frequently turn on factors which a plaintiff cannot reasonably be expected to know. For example, the official’s belief may be based on state or local law, advice of counsel, administrative practice, or some other factor of which the official alone is aware. To impose the pleading burden on the plaintiff would ignore this elementary fact and be contrary to the established practice in analogous areas of the law. 8
*642 The decision of the Court of Appeals is reversed, and the case is remanded to that court for further proceedings consistent with this opinion.
It is so ordered.
Notes
The complaint originally named the Commonwealth of Puerto Rico and the police of the Commonwealth of Puerto Rico as additional defendants, but petitioner consented to their dismissal from the action. See App. 14, n. 1.
That section grants the federal district courts jurisdiction “[t]o redress the deprivation, under color of any State law, statute, ordinance, regulation, custom or usage, of any right, 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.”
At this stage of the proceedings, of course, all allegations of the complaint must be accepted as true.
This decision was in accord with earlier decisions in that Circuit. See,
e. g., Gaffney
v.
Silk,
Other Courts of Appeals have held that the burden of pleading a defense of good faith lies with the defendant. See
Bivens
v.
Six Unknown Named Agents of Federal Bureau of Narcotics,
Section 1983 provides in full: “Every person who, under color of any statute, ordinance, regulation, custom, or usage, of any State or Territory, subjects, or causes to be subjected, any citizen of the United States or other person within the jurisdiction thereof to the deprivation of any rights, privileges, or immunities secured by the Constitution and laws, shall be liable to the party injured in an action at law, suit in equity, or other proper proceeding for redress.”
Actions under Puerto Rican law come within both § 1983 and its jurisdictional predicate, 28 U. S. C. § 1343 (3).
Examining Board
v.
Flores de Otero,
As then Dean Charles Clark stated over 40 years ago: “It seems to be considered only fair that certain types of things which in common law pleading were matters in confession and
avoidance
— i.
e., matters
which seemed more or less to admit the general complaint and yet to suggest some other reason why there was no right — must be specifically pleaded in the answer, and that has been a general rule.” ABA, Proceedings Institute at Washington and Symposium at New York City on the Federal Rules of Civil Procedure 49 (1939). See also 5 C. Wright & A. Miller, Federal Practice and Procedure §§ 1270-1271 (1969). Cf.
FTC
v.
A. E. Staley Mfg. Co.,
