*692In an action to recover damages for legal malpractice, etc., the defendants appeal, as limited by their brief, from stated portions of an order of the Supreme Court, Suffolk County (Tanenbaum, J.), dated March 18, 2004, which, inter alia, denied their motion to dismiss the complaint pursuant to CPLR 3211 (a) (5).
Ordered that the order is reversed insofar as appealed from, on the law, with costs, the motion is granted, and the complaint is dismissed.
The defendant Robert Cohen and the defendant law firm Tabat, Cohen, Blum & Kramer, LLR represented the plaintiff, Harold Sommers, in a matrimonial action in the Supreme Court, Suffolk County. The plaintiff discharged the defendants, at the latest, by a “Consent to Change Attorney” form dated August 2, 2000. On July 1, 2003, the plaintiff filed a summons and notice in Supreme Court, Suffolk County, giving notice of a legal malpractice action and naming only Cohen as a defendant. However, it is undisputed that this summons and notice was never served upon any of the defendants. On August 5, 2003, the plaintiff filed a purported amended summons and complaint alleging legal malpractice and breach of contract, and thereafter served it upon the defendants. The defendants moved to dismiss the action as time-barred pursuant to CPLR 3211 (a) (5).
The Supreme Court erred in denying the motion to dismiss. An action alleging legal malpractice accrues on the date the malpractice was committed, not when it was discovered (see McDermott v Torre, 56 NY2d 399 [1982]; Adler v Gershman, 305 AD2d 342 [2003]). Since the alleged malpractice was the defendants’ failure to file an answer in the underlying matrimonial action, the three-year statute of limitations (see CPLR 214 [6]) accrued on the last date the answer could have been filed (see Glamm v Allen, 57 NY2d 87, 93 [1982]; Venturella-Ferretti v Kinzler, 306 AD2d 465, 466 [2003]; Goicoechea v Law Offices of Stephen R. Kihl, 234 AD2d 507, 508 [1996]). However, the limitations period was tolled by the doctrine of continuous representation, pursuant to which the statute of limitations period does not begin to run until the attorney ceases representing the client on the matter which is the subject of the malpractice action (see Shumsky v Eisenstein, 96 NY2d 164, 168 [2001]; Glamm v Allen, supra at 94; Piliero v Adler & Stavros, 282 AD2d 511, 512 [2001]; Goicoechea v Law Offices of Stephen R. *693Kihl, supra). In this case, the statute of limitations began to run on the day that the defendants were relieved as counsel, i.e., August 2, 2000, the date that the plaintiff executed the “Consent to Change Attorney” (see Marro v Handwerker, Marchelos & Gayner, 1 AD3d 488 [2003]; Wester v Sussman, 287 AD2d 618 [2001]). Therefore, as the instant action was not commenced until August 5, 2003, or more than three years after August 2, 2000, it was time-barred under the statute of limitations.
The plaintiffs argument with respect to an extension of time to serve the defendants is without merit (see CPLR 306-b; Stuart v Gimpel, 2 AD3d 625 [2003]).
The defendants’ remaining contentions are academic in light of our determination. Santucci, J.P., Goldstein, Crane and Skelos, JJ., concur.