delivered the opinion of the Court.
The respondent Leon Newsome was arrested pursuant to N. Y. Penal Law § 240.35 (6) for loitering in the lobby of a New York City Housing Authority apartment building. A search of Newsome conducted at the time of his arrest produced a small quantity of heroin and related narcotics paraphernalia. Consequently, in addition to the offense of loitering, he was also charged with possession of a dangerous drug, fourth degree, N. Y. Penal Law § 220.05 (now codified, as modified, as N. Y. Penal Law § 220.03), and criminally possessing a hypodermic instrument. N. Y. Penal Law § 220.45.
The New York City Criminal Court conducted a non-jury trial on the loitering charge and a hearing on New-some’s motion to suppress the evidence seized at the time of his arrest. Newsome argued that the arresting officer did not have probable cause for the loitering arrest, that there was insufficient evidence to support a loitering conviction, and that the loitering statute was unconstitutional and therefore could not serve as the basis for either a loitering conviction or a lawful search incident to arrest. The court rejected these arguments, found Newsome guilty of loitering, and denied the motion to suppress.
One month later, on the date scheduled for trial on the drug charges, Newsome withdrew his prior pleas of not guilty and pleaded guilty to the lesser charge of attempted possession of dangerous drugs. N. Y. Penal Law § 110. He was immediately sentenced to 90 days’ imprisonment on the attempted-possession conviction and received an unconditional release on the loitering conviction.
*285At the sentencing proceeding Newsome indicated his intention to appeal both the loitering conviction and the denial of his motion to suppress the drugs and related paraphernalia seized at the time of his arrest. Appeal of the adverse decision on the motion to suppress was authorized by N. Y. Code Crim. Proc. § 813-c (now re-codified as N. Y. Crim. Proc. Law §§ 710.20 (1), 710.70 (2)), which provided that an order denying a motion to suppress evidence alleged to have been obtained as a result of unlawful search and seizure “may be reviewed on appeal from a judgment of conviction notwithstanding the fact that such judgment of conviction is predicated upon a plea of guilty.” 1 •
On direct appeal to the Appellate Term of the New York Supreme Court, the loitering conviction was reversed for insufficient' evidence and a defective information. Because the court held that there was probable cause to arrest Newsome for loitering, however, the search incident to that arrest was upheld and the drug conviction affirmed. Newsome sought further review of the drug conviction, but leave to appeal to the New York Court of Appeals was denied. This Court denied a petition for a writ of certiorari. Newsome v. New York, 405 U. S. 908.
Newsome then filed a petition for a writ of habeas corpus in the District Court for the Eastern District of *286New York. The petition reiterated the claim that the loitering statute was unconstitutional, that Newsome's arrest was therefore invalid, and that as a result the evidence seized incident to that arrest should have been suppressed. Prior to the District Court's decision on the merits of Newsome’s petition,2 the New York Court of Appeals declared New York's loitering statute unconstitutional. People v. Berck, 32 N. Y. 2d 567, 300 N. E. 2d 411. In light of the Berck decision, the District Court granted Newsome’s application for a writ of habeas corpus.
The petitioner, the Attorney General of New York, who had been granted leave by the District Court to intervene as a respondent in the habeas corpus proceeding, appealed. The Court of Appeals for the Second Circuit affirmed the judgment of the District Court, United States ex rel. Newsome v. Malcolm, 492 F. 2d 1166, adhering to its earlier rulings that a New York defendant who has utilized state procedures to appeal the denial of a motion to suppress may pursue his constitutional claim on a federal habeas corpus petition although the conviction was based on a plea of guilty. Id., at 1169-1171. The court held that New York’s loitering statute violated due process because it failed to specify adequately the conduct it proscribed and failed to provide sufficiently clear guidance for police, prosecutors, and the courts so that they could enforce the statute in a manner consistent with the constitutional requirement that arrests be based on probable cause. Id., at 1171-1174. *287Accordingly, the court held that because Newsome was searched incident to an arrest for the violation of a statute found to be unconstitutional on the ground that it substituted mere suspicion for probable cause as the basis for arrest, the search of Newsome was also constitutionally invalid. The court concluded that the evidence seized should have been suppressed, and affirmed the District Court’s judgment granting the writ of habeas corpus. Id., at 1174-1175.
The Attorney General of New York sought review here of both the Court of Appeals’ decision that Newsome had not waived his right to file a federal habeas corpus petition by pleading guilty and its decision as to the constitutionality of New York’s loitering statute. Because of a conflict between the judgment in the present case and a decision of the Court of Appeals for the Ninth Circuit,3 we granted certiorari limited to the question of a defendant’s right to file a federal habeas corpus petition challenging the lawfulness of a search or the voluntariness of a confession or presenting other constitutional claims when a State provides for appellate review of those issues after a guilty plea. 417 U. S. 967.4
*288I
In contending that Newsome is precluded from raising his constitutional claims in this federal habeas corpus proceeding, the petitioner relies primarily on this Court’s decisions in the guilty-plea trilogy of Brady v. United States, 397 U. S. 742, McMann v. Richardson, 397 U. S. 759, and Parker v. North Carolina, 397 U. S. 790, and on our decision in Tollett v. Henderson, 411 U. S. 258. The Brady trilogy announced the general rule that a guilty plea, intelligently and voluntarily made, bars the later assertion of constitutional challenges to the pretrial proceedings. This principle was reaffirmed in Tollett v. Henderson, supra, at 267: "When a criminal defendant has solemnly admitted in open court that he is in fact guilty of the offense with which he is charged, he may not thereafter raise independent claims relating to the deprivation of constitutional rights that occurred prior to the entry of the guilty plea.”
But the Court also suggested in the Brady trilogy that an exception to this general rule might be proper when a State decides to permit a defendant to appeal from an adverse ruling in a pretrial hearing despite the fact that his conviction is based on a guilty plea. See McMann v. Richardson, supra, at 766, and n. 11, 770 n. 13.5 The justification for such an exception lies in the special *289nature of the guilty plea of a New York defendant like Newsome.
In most States a defendant must plead not guilty and go to trial to preserve the opportunity for state appellate review of his constitutional challenges to arrest, admissibility of various pieces of evidence, or the voluntariness of a confession. A defendant who chooses to plead guilty rather than go to trial in effect deliberately refuses to present his federal claims to the state court in the first instance. McMann v. Richardson, supra, at 768. Once the defendant chooses to bypass the orderly procedure for litigating his constitutional claims in order to take the benefits, if any, of a plea of guilty, the State acquires a legitimate expectation of finality in the conviction thereby obtained. Cf. Fay v. Noia, 372 U. S. 391, 438. It is in this sense, therefore, that ordinarily “a guilty plea represents a break in the chain of events which has preceded it in the criminal process.” Tollett v. Henderson, supra, at 267.
New York, however, has chosen not to treat a guilty plea as such a “break in the chain of events” with regard to certain types of constitutional claims raised in pretrial proceedings. For a New York defendant whose basic defense consists of one of those constitutional claims and who has already lost a pretrial motion to suppress based on that claim, there is no practical difference in terms of appellate review between going to trial and pleading guilty. In neither event does the State assert any claim of finality because of the judgment of conviction. In either event under New York procedure the defendant has available the full range of state appellate review of his constitutional claims. As to those claims, therefore, there is no “break” at all in the usual state procedure for adjudicating constitutional issues. The guilty plea operates simply as a procedure by which the constitutional issues can be litigated without the necessity of *290going through the time and effort of conducting a trial, the result of which is foreordained if the constitutional claim is invalid. The plea is entered with the clear understanding and expectation by the State, the defendant, and the courts that it will not foreclose judicial review of the merits of the alleged constitutional violations.6
In sum, although termed by the New York Criminal Procedure Law a “guilty plea,” the same label given to the pleas entered by the defendants in the Brady trilogy of cases and Tollett v. Henderson, Newsome’s plea had legal consequences quite different from the consequences of the pleas entered in traditional guilty-plea cases. Far from precluding review of independent claims relating to the deprivation of constitutional rights that occurred prior to the entry of his “guilty plea,” Newsome’s plea carried with it the guarantee that judicial review of his constitutional claims would continue to be available to him. In this respect there is no meaningful difference between Newsome’s conviction and a New York conviction entered after a trial.7
*291Because of the entirely different expectations surrounding Newsome’s plea and the completely different legal consequences flowing from it, earlier guilty-plea cases holding that “[t]he focus of federal habeas inquiry is the nature of the advice [of counsel] and the voluntariness of the plea, not the existence as such of an antecedent constitutional infirmity,” Tollett v. Henderson, supra, at 266, are simply inapposite. Newsome has satisfied all the prerequisites for invoking the habeas corpus jurisdiction of the federal courts.8 He is no less entitled to federal review of his constitutional claim than is any other defendant who raises his claim in a timely fashion, in accordance with state procedure, and who pursues his *292claim through all available levels of state appellate review.9
II
Denying Newsome the right to file a federal habeas corpus petition raising his claim of an unconstitutional seizure would not only deprive him of a federal forum despite the fact that he has satisfied all the requirements for invoking federal habeas corpus jurisdiction, it would also frustrate the State’s policy in providing for post-guilty plea appellate review of pretrial motions to suppress.
Many defendants recognize that they cannot prevail at trial unless they succeed in suppressing either evidence seized by the police or an allegedly involuntary confession. Such defendants in States with the generally prevailing rule of finality of guilty pleas will often insist on proceeding to trial for the sole purpose of preserving their claims of illegal seizures or involuntary confessions for potential vindication on direct appellate review or in collateral proceedings. Recognizing the completely unnecessary waste of time and energy consumed in such trials, New York has chosen to discourage them by creating a procedure which permits a defendant to *293obtain appellate review of certain pretrial constitutional claims without imposing on the State the burden of going to trial.
To deny federal habeas corpus relief to those in New-some’s position would make New York’s law a trap for the unwary.10 On the other hand, it is safe to predict that those New York defendants who knew that federal habeas corpus would be foreclosed would again be dissuaded from pleading guilty and instead would insist on •a trial solely to preserve the right to an ultimate federal forum in which to litigate their constitutional claims. Such a result would eviscerate New York’s commendable efforts to relieve the problem of congested criminal trial calendars in a manner that does not diminish the opportunity for the assertion of rights guaranteed by the Constitution.11
Accordingly, we hold that when state law permits a defendant to plead guilty without forfeiting his right to judicial review of specified constitutional issues, the defendant is not foreclosed from pursuing those constitutional claims in a federal habeas corpus proceeding. The judgment of the Court of Appeals for the Second Circuit is affirmed.
It is so ordered.
Section 813-c was directed to the right to appeal an adverse ruling on a claim of an unlawful search and seizure after a plea of guilty. N. Y. Code Crim. Proc. § 813-g (recodified as N. Y. Crim. Proc. Law §§ 710.20,(3), 710.70 (2)), permitted similar appeals from denials of motions to suppress allegedly coerced confessions. See McMann v. Richardson, 397 U. S. 759, 766 n. 11. New York now also provides by statute for post-guihy plea appeals from denials of motions to suppress identification testimony claimed to be tainted by improper pretrial identifications. N. Y. Crim. Proc. Law §§710.20 (5), 710.70 (2).
The District Court initially dismissed the petition because New-some, who had been released on bail pending final disposition of his case, was not "in custody” as required by 28 U. S. C. §2241. Newsome appealed the dismissal, and, in light of this Court's holding on the custody question in Hensley v. Municipal Court, 411 U. S. 345, the Court of Appeals for the Second Circuit remanded the case to the District Court for a decision on the merits.
California, like New York, permits a defendant to appeal specified adverse pretrial rulings even though he subsequently pleads guilty. Cal. Penal Code § 1538.5 (m). Unlike the Court of Appeals for the Second Circuit, however, the Court of Appeals for the Ninth Circuit by a divided vote held that such a defendant may not pursue his constitutional claim on a federal habeas corpus petition. Mann v. Smith, 488 F. 2d 245, 247.
Certiorari was granted limited to Question 1 in Attorney General Lefkowitz’ petition: “Does a state defendant’s plea of guilty waive federal habeas corpus review of his conviction, even though under state law he has been permitted review in the state appellate courts of the denial of his motion, on constitutional grounds, to suppress the evidence that would have been offered against him had there been a trial?” 417 U. S. 967.
Since the guilty pleas in McMann v. Richardson were entered prior to the effective date of New York’s statutory scheme permitting a defendant pleading guilty to challenge on appeal the admissibility of evidence allegedly seized improperly or of an allegedly coerced confession, the Court in McMann expressly reserved ruling on the question presented by the judgment now before us. 397 U. S., at 770 n. 13. That express reservation unquestionably belies the argument advanced in the dissenting opinion of MR. Justice White, post, at 297-298, that the question before us was answered in Parker v. North Carolina, 397 U. S. 790, a case decided together with McMann.
The petitioner concedes that this review ultimately includes the certiorari or appellate jurisdiction of this Court. Indeed, in Sibron v. New York, 392 U. S. 40, we reversed a state-court conviction on the ground that the appellant’s motion to suppress evidence should have been granted, notwithstanding the fact that the appellant had pleaded guilty and pursued his appeal under § 813-c. See id., at 45 n. 2. If Newsome’s guilty plea is not a sufficient “break in the chain of events [that] preceded it” to prevent review of his constitutional claims in this Court, then a fortiori the plea cannot rationally foreclose resort to federal habeas relief. For even when state procedural grounds are adequate to bar direct review of a conviction in this Court, federal habeas corpus relief is nonetheless available to litigate the defendant’s constitutional claims unless there has been a deliberate bypass of the state procedures. See Fay v. Noia, 372 U. S. 391, 428-431.
New York could easily have provided that, rather than pleading *291“guilty,” a defendant who intends to appeal his pretrial claim of an involuntary confession or an unlawful seizure but has no desire to impose upon the State the burden of going to trial should plead “not guilty” and at the same time stipulate to all the evidence the State can introduce to prove his guilt. Upon the inevitable entry of a judgment of conviction based on the stipulation, the defendant would then be able to pursue his state appellate remedies. And, presumably, because there would then be no “solemn admission of guilt,” all would concede that the defendant would not be foreclosed from pursuing those constitutional claims in a federal habeas corpus proceeding. But the only difference between such a procedure and the one New York has chosen is that the plea entered is labeled a plea of “not guilty” rather than “guilty” and there is a stipulation by the defendant as to the facts the State would prove demonstrating his guilt rather than a recitation by the defendant in court. The availability of federal habeas corpus depends upon functional reality, not upon an infatuation with labels. See Fay v. Noia, supra.
Newsome is “in custody” within the meaning of 28 U. S. C. § 2241. See n. 2, supra. His petition for a writ of habeas corpus alleged that this custody was in violation of the laws of the United States. §2241 (c)(3). And he has satisfied the exhaustion requirement of 28 U. S. C. §2254 by presenting his federal claims to the state courts on direct appeal. See Francisco v. Gathright, 419 U. S. 59.
In Fay v. Noia, supra, the Court held that a federal habeas judge may deny relief to an applicant who has deliberately bypassed the orderly state-court procedures for reviewing his constitutional claim. 372 U. S., at 438. But the Court also held that if the state courts have entertained the federal constitutional claims on the merits in a subsequent proceeding, notwithstanding the deliberate bypass, the federal courts have no discretion to deny the applicant habeas relief to which he is otherwise entitled. Id., at 439. It would seem to follow necessarily that when there is no bypass of state appellate procedures, deliberate or otherwise, and the state courts entertained the federal claims on the merits, a federal habeas corpus court must also determine the merits of the applicant’s claim.
At the time Newsome pleaded guilty the Court of Appeals for the Second Circuit had repeatedly held that a New York defendant who has utilized § 813-c in the state courts may pursue his constitutional claim on a federal habeas corpus petition. E. g., United States ex rel. Rogers v. Warden, 381 F. 2d 209; United States ex rel. Molloy v. Follette, 391 F. 2d 231.
The Uniform Rules of Criminal Procedure would create an even broader right of appeal than is currently provided for in New York, permitting post-guilty-plea appeal of any order denying a pretrial motion which, if granted, would be dispositive of the case. Uniform Rule Crim. Proc. 444 (d).