Mr. Justice Marshall
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 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. Basing jurisdiction on 28 U. S. C. § 1343 (3), petitioner alleged the following facts in his complaint. 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 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 the complaint. The United States Court of Appeals for the First Circuit affirmed. 602 F. 2d 1018 (1979).
We granted certiorari to resolve a conflict among the Courts of Appeals. 444 U. S. 1031 (1980). We now reverse.
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. This statute, enacted to aid in “ The preservation of human liberty and human rights,’ ” Owen v. City of Independence, 445 U. S. 622, 636 (1980), quoting Cong. Globe, 42d Cong., 1st Sess., App. 68 (1871) (Rep. Shellabarger), reflects a congressional judgment that a “damages remedy against the offending party is a vital component of any scheme for vindicating cherished constitutional guarantees,” 445 U. S., at 651. As remedial legislation, § 1983 is to be construed generously to further its primary purpose. See 445 U. S., at 636.
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.” 445 U. S., at 638. Findings of immunity have thus been “predicated upon a considered inquiry into the immunity historically accorded the relevant official at common law and the interests behind it.” Imbler v. Pachtman, 424 U. S. 409, 421 (1976). In Pierson v. Ray, 386 U. S. 547, 555 (1967), for example, we concluded that a police officer would be “excus[ed] from liability for acting under a statute that he reasonably believed to be valid but that was later held unconstitutional, on its face or as applied.” And in other contexts we have held, on the basis of “[c]ommon-law tradition . . . and strong public-policy reasons,” Wood v. Strickland, 420 U. S. 308, 318 (1975), that certain categories of executive officers should be allowed qualified immunity from liability for acts done on the basis of an objectively reasonable belief that those acts were lawful. See Procunier v. Navarette, 434 U. S. 555 (1978) (prison officials); O’Connor v. Donaldson, 422 U. S. 563 (1975) (superintendent of state hospital); Wood v. Strickland, supra (local school board members); Scheuer v. Rhodes, 416 U. S. 232 (1974) (state Governor and other executive officers). Cf. Owen v. City of Independence, supra (no qualified immunity for municipalities).
Nothing in the language or legislative history of § 1983, 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, 365 U. S. 167, 171 (1961). Petitioner has made both of the required allegations. He alleged that his discharge by respondent violated his right to procedural due process, see Board of Regents v. Roth, 408 U. S. 564 (1972), and that respondent acted under color of Puerto Rican law. See Monroe v. Pape, supra, at 172-187.
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, 438 U. S. 478, 508 (1978). Since qualified immunity is a defense, the burden of pleading it rests with the defendant. See Fed. Rule Civ. Proc. 8 (c) (defendant must plead any “matter constituting an avoidance or affirmative defense”) ; 5 C. Wright & A. Miller, Federal Practice and Procedure § 1271 (1969). It is for the official to claim that his conduct was justified by an objectively reasonable belief that it was lawful. We see no basis for imposing on the plaintiff an obligation to anticipate such a defense by stating in his complaint that the defendant acted in bad faith.
Our conclusion as to the allocation of the burden of pleading is supported by the nature of the qualified immunity 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.
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.
Mr. Justice Rehnquist joins the opinion of the Court, reading it as he does to leave open the issue of the burden of persuasion, as opposed to the burden of pleading, with respect to a defense of qualified immunity.
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, 488 F. 2d 1248 (1973); Kostka v. Hogg, 560 F. 2d 37 (1977); Maiorana v. MacDonald, 596 F. 2d 1072 (1979).
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, 456 F. 2d 1339, 1348 (CA2 1972) ; Skehan v. Board of Trustees of Bloomsburg State College, 538 F. 2d 53, 61-62 (CA3) (en banc), cert. denied, 429 U. S. 979 (1976); Bryan v. Jones, 530 F. 2d 1210, 1213 (CA5) (en banc), cert. denied, 429 U. S. 865 (1976); Jones v. Perrigan, 459 F. 2d 81, 83 (CA6 1972); Tritsis v. Backer, 501 F. 2d 1021, 1022-1023 (CA7 1974); Landrum v. Moats, 576 F. 2d 1320, 1324-1325, 1329 (CA8), cert. denied, 439 U. S. 912 (1978); Martin v. Duffie, 463 F. 2d 464, 468 (CA10 1972); Dellums v. Powell, 184 U. S. App. D. C. 275, 284-285, 566 F. 2d 167, 175-176 (1977), cert. denied, 438 U. S. 916 (1978). Cf. McCray v. Burrell, 516 F. 2d 357, 370 (CA4 1975) (en banc) (burden of proof), cert. dism’d, 426 U. S. 471 (1976); Gilker v. Baker, 576 F. 2d 245 (CA9 1978) (same).
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, 426 U. S. 672 (1976).
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., 324 U. S. 746, 759 (1945) (good-faith defense under Robinson-Patman Act); Barcellona v. Tiffany English Pub., Inc., 597 F. 2d 464, 468 (CA5 1979); Cohen v. Ayers, 596 F. 2d 733, 739-740 (CA7 1979); United States v. Kroll, 547 F. 2d 393 (CA7 1977).
attorney general of the United States, or his office specified state board or department of education city, town, township, village, or borough government or governmental unit state commission, board, committee, or authority county government or county governmental unit, except school district court or judicial district state department or agency governmental employee or job applicant female governmental employee or job applicant minority governmental employee or job applicant minority female governmental employee or job applicant not listed among agencies in the first Administrative Action variable retired or former governmental employee U.S. House of Representatives interstate compact judge state legislature, house, or committee local governmental unit other than a county, city, town, township, village, or borough governmental official, or an official of an agency established under an interstate compact state or U.S. supreme court local school district or board of education U.S. Senate U.S. senator foreign nation or instrumentality state or local governmental taxpayer, or executor of the estate of state college or university United States State person accused, indicted, or suspected of crime advertising business or agency agent, fiduciary, trustee, or executor airplane manufacturer, or manufacturer of parts of airplanes airline distributor, importer, or exporter of alcoholic beverages alien, person subject to a denaturalization proceeding, or one whose citizenship is revoked American Medical Association National Railroad Passenger Corp. amusement establishment, or recreational facility arrested person, or pretrial detainee attorney, or person acting as such;includes bar applicant or law student, or law firm or bar association author, copyright holder bank, savings and loan, credit union, investment company bankrupt person or business, or business in reorganization establishment serving liquor by the glass, or package liquor store water transportation, stevedore bookstore, newsstand, printer, bindery, purveyor or distributor of books or magazines brewery, distillery broker, stock exchange, investment or securities firm construction industry bus or motorized passenger transportation vehicle business, corporation buyer, purchaser cable TV car dealer person convicted of crime tangible property, other than real estate, including contraband chemical company child, children, including adopted or illegitimate religious organization, institution, or person private club or facility coal company or coal mine operator computer business or manufacturer, hardware or software consumer, consumer organization creditor, including institution appearing as such; e.g., a finance company person allegedly criminally insane or mentally incompetent to stand trial defendant debtor real estate developer disabled person or disability benefit claimant distributor person subject to selective service, including conscientious objector drug manufacturer druggist, pharmacist, pharmacy employee, or job applicant, including beneficiaries of employer-employee trust agreement, employee health and welfare fund, or multi-employer pension plan electric equipment manufacturer electric or hydroelectric power utility, power cooperative, or gas and electric company eleemosynary institution or person environmental organization employer. If employer's relations with employees are governed by the nature of the employer's business (e.g., railroad, boat), rather than labor law generally, the more specific designation is used in place of Employer. farmer, farm worker, or farm organization father female employee or job applicant female movie, play, pictorial representation, theatrical production, actor, or exhibitor or distributor of fisherman or fishing company food, meat packing, or processing company, stockyard foreign (non-American) nongovernmental entity franchiser franchisee lesbian, gay, bisexual, transexual person or organization person who guarantees another's obligations handicapped individual, or organization of devoted to health organization or person, nursing home, medical clinic or laboratory, chiropractor heir, or beneficiary, or person so claiming to be hospital, medical center husband, or ex-husband involuntarily committed mental patient Indian, including Indian tribe or nation insurance company, or surety inventor, patent assigner, trademark owner or holder investor injured person or legal entity, nonphysically and non-employment related juvenile government contractor holder of a license or permit, or applicant therefor magazine male medical or Medicaid claimant medical supply or manufacturing co. racial or ethnic minority employee or job applicant minority female employee or job applicant manufacturer management, executive officer, or director, of business entity military personnel, or dependent of, including reservist mining company or miner, excluding coal, oil, or pipeline company mother auto manufacturer newspaper, newsletter, journal of opinion, news service radio and television network, except cable tv nonprofit organization or business nonresident nuclear power plant or facility owner, landlord, or claimant to ownership, fee interest, or possession of land as well as chattels shareholders to whom a tender offer is made tender offer oil company, or natural gas producer elderly person, or organization dedicated to the elderly out of state noncriminal defendant political action committee parent or parents parking lot or service patient of a health professional telephone, telecommunications, or telegraph company physician, MD or DO, dentist, or medical society public interest organization physically injured person, including wrongful death, who is not an employee pipe line company package, luggage, container political candidate, activist, committee, party, party member, organization, or elected official indigent, needy, welfare recipient indigent defendant private person prisoner, inmate of penal institution professional organization, business, or person probationer, or parolee protester, demonstrator, picketer or pamphleteer (non-employment related), or non-indigent loiterer public utility publisher, publishing company radio station racial or ethnic minority person or organization protesting racial or ethnic segregation or discrimination racial or ethnic minority student or applicant for admission to an educational institution realtor journalist, columnist, member of the news media resident restaurant, food vendor retarded person, or mental incompetent retired or former employee railroad private school, college, or university seller or vendor shipper, including importer and exporter shopping center, mall spouse, or former spouse stockholder, shareholder, or bondholder retail business or outlet student, or applicant for admission to an educational institution taxpayer or executor of taxpayer's estate, federal only tenant or lessee theater, studio forest products, lumber, or logging company person traveling or wishing to travel abroad, or overseas travel agent trucking company, or motor carrier television station union member unemployed person or unemployment compensation applicant or claimant union, labor organization, or official of veteran voter, prospective voter, elector, or a nonelective official seeking reapportionment or redistricting of legislative districts (POL) wholesale trade wife, or ex-wife witness, or person under subpoena network slave slave-owner bank of the united states timber company u.s. job applicants or employees Army and Air Force Exchange Service Atomic Energy Commission Secretary or administrative unit or personnel of the U.S. Air Force Department or Secretary of Agriculture Alien Property Custodian Secretary or administrative unit or personnel of the U.S. Army Board of Immigration Appeals Bureau of Indian Affairs Bonneville Power Administration Benefits Review Board Civil Aeronautics Board Bureau of the Census Central Intelligence Agency Commodity Futures Trading Commission Department or Secretary of Commerce Comptroller of Currency Consumer Product Safety Commission Civil Rights Commission Civil Service Commission, U.S. Customs Service or Commissioner of Customs Defense Base Closure and REalignment Commission Drug Enforcement Agency Department or Secretary of Defense (and Department or Secretary of War) Department or Secretary of Energy Department or Secretary of the Interior Department of Justice or Attorney General Department or Secretary of State Department or Secretary of Transportation Department or Secretary of Education U.S. Employees' Compensation Commission, or Commissioner Equal Employment Opportunity Commission Environmental Protection Agency or Administrator Federal Aviation Agency or Administration Federal Bureau of Investigation or Director Federal Bureau of Prisons Farm Credit Administration Federal Communications Commission (including a predecessor, Federal Radio Commission) Federal Credit Union Administration Food and Drug Administration Federal Deposit Insurance Corporation Federal Energy Administration Federal Election Commission Federal Energy Regulatory Commission Federal Housing Administration Federal Home Loan Bank Board Federal Labor Relations Authority Federal Maritime Board Federal Maritime Commission Farmers Home Administration Federal Parole Board Federal Power Commission Federal Railroad Administration Federal Reserve Board of Governors Federal Reserve System Federal Savings and Loan Insurance Corporation Federal Trade Commission Federal Works Administration, or Administrator General Accounting Office Comptroller General General Services Administration Department or Secretary of Health, Education and Welfare Department or Secretary of Health and Human Services Department or Secretary of Housing and Urban Development Interstate Commerce Commission Indian Claims Commission Immigration and Naturalization Service, or Director of, or District Director of, or Immigration and Naturalization Enforcement Internal Revenue Service, Collector, Commissioner, or District Director of Information Security Oversight Office Department or Secretary of Labor Loyalty Review Board Legal Services Corporation Merit Systems Protection Board Multistate Tax Commission National Aeronautics and Space Administration Secretary or administrative unit of the U.S. Navy National Credit Union Administration National Endowment for the Arts National Enforcement Commission National Highway Traffic Safety Administration National Labor Relations Board, or regional office or officer National Mediation Board National Railroad Adjustment Board Nuclear Regulatory Commission National Security Agency Office of Economic Opportunity Office of Management and Budget Office of Price Administration, or Price Administrator Office of Personnel Management Occupational Safety and Health Administration Occupational Safety and Health Review Commission Office of Workers' Compensation Programs Patent Office, or Commissioner of, or Board of Appeals of Pay Board (established under the Economic Stabilization Act of 1970) Pension Benefit Guaranty Corporation U.S. Public Health Service Postal Rate Commission Provider Reimbursement Review Board Renegotiation Board Railroad Adjustment Board Railroad Retirement Board Subversive Activities Control Board Small Business Administration Securities and Exchange Commission Social Security Administration or Commissioner Selective Service System Department or Secretary of the Treasury Tennessee Valley Authority United States Forest Service United States Parole Commission Postal Service and Post Office, or Postmaster General, or Postmaster United States Sentencing Commission Veterans' Administration War Production Board Wage Stabilization Board General Land Office of Commissioners Transportation Security Administration Surface Transportation Board U.S. Shipping Board Emergency Fleet Corp. Reconstruction Finance Corp. Department or Secretary of Homeland Security Unidentifiable International Entity