*925In an action, inter alia, to recover damages for legal malpractice, the plaintiff appeals from an order of the Supreme Court, Richmond County (Fusco, J.), entered September 25, 2009, which, in effect, granted that branch of the defendant’s motion which was for summary judgment dismissing the complaint.
Ordered that the order is affirmed, with costs.
In 2004 the plaintiff retained the defendant attorney to represent him in connection with a criminal investigation, which ultimately resulted in the plaintiffs arrest on March 4, 2005, pursuant to a federal indictment. On March 9, 2006, the plaintiff pleaded guilty to all charges in the indictment. He subsequently commenced this action, inter alia, to recover damages for legal malpractice, alleging that, but for the defendant’s negligent representation, he would not have been publicly arrested and would not have pleaded guilty to the charges in the federal indictment.
Prior to filing and serving an answer, the defendant moved to dismiss the complaint pursuant to CPLR 3211 (a) (1) and (7) or, in the alternative, for summary judgment pursuant to CPLR 3211 (c). The parties submitted affidavits and evidence in support of, and in opposition to, the motion. Where, as here, the parties have charted a course for summary judgment and the question presented is purely legal, it was proper for the Supreme Court to determine that branch of the motion which was for summary judgment dismissing the complaint, even without giving formal notice to the parties pursuant to CPLR 3211 (c) (see Cook v Schapiro, 58 AD3d 664, 665 [2009]; New Franklin Nursing Home v Novello, 297 AD2d 720, 722 [2002]; Kulier v Harran Transp. Co., 189 AD2d 803, 804 [1993]).
To succeed on a “cause of action for legal malpractice arising from negligent representation in a criminal proceeding, [the] plaintiff must allege his innocence or a colorable claim of innocence of the underlying offense” (Carmel v Lunney, 70 NY2d 169, 173 [1987]; see Britt v Legal Aid Socy., 95 NY2d 443, 448 [2000]; Daly v Peace, 54 AD3d 801, 802 [2008]). “A plea of guilty bars recovery for legal malpractice, '[r]egardless of the plaintiffs subjective reasons for pleading guilty’ ” (Casement v O’Neill, 28 AD3d 508, 509 [2006], quoting Kaplan v Sachs, 224 AD2d 666, 667 [1996]).
Here, the defendant established his prima facie entitlement *926to judgment as a matter of law dismissing the complaint with evidence that the plaintiff pleaded guilty to the underlying criminal charges. In opposition, the plaintiff failed to raise a triable issue of fact as to his innocence or as to whether his plea of guilty has been vacated and the indictment dismissed.
The plaintiffs remaining contentions are without merit.
Accordingly, the Supreme Court properly, in effect, granted that branch of the defendant’s motion which was for summary judgment dismissing the complaint (see Britt v Legal Aid Socy., 95 NY2d at 448; Carmel v Lunney, 70 NY2d at 173; Daly v Peace, 54 AD3d at 802; Casement v O’Neill, 28 AD3d at 509). Rivera, J.P., Angiolillo, Chambers and Austin, JJ., concur.