ORDER
An Illinois court convicted Jeffrey Scott of possessing cocaine and sentenced him to probation. Mr. Scott then filed a federal complaint under 42 U.S.C. §§ 1983 and 1985 alleging that the arresting officer, the *449prosecutor, and the state judge involved in his case conspired together to violate his constitutional rights. The district court dismissed Mr. Scott’s case without prejudice, and Mr. Scott appeals.
Mr. Scott theorizes that the state defendants wanted to prevent him from helping the CIA and the Defense Intelligence Agency investigate the Chicago Police Department and the Cook County Sheriffs Department. In his 70-page complaint, Mr. Scott alleges that his cocaine was seized without probable cause, and that these defendants are responsible for him being falsely imprisoned, convicted on perjured testimony, sentenced to onerous conditions of probation based on an inaccurate presentence investigation report, and deprived of the effective assistance of counsel. The district court dismissed Mr. Scott’s action without prejudice, noting only that “[tjhere is no federal jurisdiction for the relief sought.”
Although the district court misspoke, expressing its dismissal in jurisdictional terms, the record reflects that the dismissal was proper because Mr. Scott’s complaint fails to state a claim. By now it is well established that a § 1983 plaintiff may not raise claims that, if correct, would necessarily imply the invalidity of a state conviction or sentence unless and until that conviction or sentence has been set aside. See Heck v. Humphrey, 512 U.S. 477, 486-87, 114 S.Ct. 2364, 129 L.Ed.2d 383 (1994); Apampa v. Layng, 157 F.3d 1103, 1105 (7th Cir.1999). As to virtually all of Mr. Scott’s allegations, a ruling in his favor would necessarily undermine the validity of the state judgment, and so Heck renders his allegations premature. Dismissal without prejudice, therefore, was for the most part correct. See Simpson v. Rowan, 73 F.3d 134, 136 (7th Cir.1995).
The one exception is Mr. Scott’s Fourth Amendment claim, which although not Heck-barred, see Copus v. City of Edgerton, 151 F.3d 646, 649 (7th Cir.1998), should have been dismissed with prejudice because Mr. Scott is collaterally estopped from pursuing the claim in federal court. Under the doctrine of collateral estoppel- or issue preclusion-a question actually and necessarily decided by a court of competent jurisdiction is conclusive in all subsequent legal actions involving a party to the prior litigation. See Adair v. Sherman, 230 F.3d 890, 893 (7th Cir.2000). Collateral estoppel can be used to bar a § 1983 claimant from relitigating a Fourth Amendment search-and-seizure claim that he lost at a state suppression hearing. See Allen v. McCurry, 449 U.S. 90, 104-05, 101 S.Ct. 411, 66 L.Ed.2d 308 (1980); Guenther v. Holmgreen, 738 F.2d 879, 883 (7th Cir.1984).
Federal courts are required to give prior state-court judgments “the same full faith and credit” that the judgment would receive in that state. 28 U.S.C. § 1738; see also Allen, 449 U.S. at 96. In Illinois, collateral estoppel applies if “(1) the issue decided in the prior adjudication is identical with the one presented in the suit in question, (2) there was a final judgment on the merits in the prior adjudication, and (3) the party against whom estoppel is asserted was a party or in privity with a party to the prior adjudication.” Talarico v. Dunlap, 177 Ill.2d 185, 226 Ill.Dec. 222, 685 N.E.2d 325, 328 (Ill.1997). Further, “a decision on the issue must have been necessary for the judgment in the first litigation, and the person to be bound must have actually litigated the issue in the first suit.” Id.
In this case the Fourth Amendment claim Mr. Scott seeks to raise in his § 1983 lawsuit is identical to that actually litigated at the suppression hearing. Moreover, the state court’s adverse resolution of Mr. Scott’s Fourth Amendment claim was es*450sential to Ms ultimate conviction, for without the cocaine seized during the barroom search the prosecution would have had no evidence of illegal conduct. Thus, Mr. Scott is estopped from relitigating his Fourth Amendment claim by way of § 1983, and the district court should have dismissed this claim with prejudice.1
For the foregoing reasons, we AFFIRM the dismissal of Mr. Scott’s complaint without prejudice, except that we MODIFY the dismissal of Ms Fourth Amendment claim to be with prejudice.
AFFIRMED AS MODIFIED.
. We note that collateral estoppel is an affirmative defense, one that normally places on the defendants the burden of establishing the necessary elements. See Adair v. Sherman, 230 F.3d 890, 894 (7th Cir.2000). The district court dismissed this case, however, before any of the defendants answered the complaint or entered an appearance. Nonetheless, courts are free to raise issues of preclusion even if the parties fail to do so or, as in this instance, had no opportunity to do so. Kratville v. Runyon, 90 F.3d 195, 198 (7th Cir.1996).