
191 Mich. App. 312 (1991)
477 N.W.2d 114
HOOPER
v.
HILL LEWIS
Docket No. 117105.
Michigan Court of Appeals.
Decided May 9, 1991.
Approved for publication September 26, 1991, at 9:00 A.M.
E.R. Whinham, for George W. Parker, as conservator for Joseph C. Hooper, Jr.
Garan, Lucow, Miller, Seward, Cooper & Becker, P.C. (by Richard E. Eaton and Nancy J. Bourget), for the defendants.
Before: WEAVER, P.J., and MacKENZIE and GRIBBS, JJ.
PER CURIAM.
This is a legal malpractice action. Appellant, on behalf of plaintiff, appeals as of right from an order granting summary disposition in favor of defendants on the basis that plaintiff's action was barred by the two-year period of limitation set forth at MCL 600.5805; MSA 27A.5805, MCL 600.5838; MSA 27A.5838. We affirm.
Plaintiff, an attorney, hired defendants in June 1985 to represent him in litigation related to his parents' estates. On December 11 or 13, 1985, a settlement agreement was reached in the probate action and was placed on the record.
After the settlement was entered, the bank responsible for the preparation of the estates' final accountings apparently refused to deal with plaintiff and instead chose to serve the defendants with copies of two proposed final accountings. In June 1986, the firm sent a letter to plaintiff stating that a "court hearing on the part of the bank is being scheduled which will require your attendance." Plaintiff responded with a letter, dated June 17, 1986, which stated in part:
I understand that your office is trying to communicate *314 with me. I am totally dumbfounded by your failure to communicate with me directly to my proper and correct mailing address....
Additionally, if you had wanted to call me, you simply could have gotten my number from directory information service. All of you knew where I was and how to communicate with me.

Please be advised that you are not authorized to waive any of my rights or act on my behalf. [Emphasis added.]
Defendants subsequently moved in the probate court to withdraw as counsel of record. An order allowing the firm to withdraw was entered on October 9, 1986.
Plaintiff filed this action on October 6, 1988.
A legal malpractice claim must be brought within two years of the date the attorney discontinues serving the client or within six months after the client discovers or should have discovered the claim, whichever is later. MCL 600.5805; MSA 27A.5805, MCL 600.5838; MSA 27A.5838; Seebacher v Fitzgerald, Hodgman, Cawthorne & King, PC, 181 Mich App 642, 646; 449 NW2d 673 (1989). In this case, discovery is not at issue; the dispute is over when defendants discontinued serving plaintiff.
At the hearing on defendants' motion for summary disposition, defendants maintained that they discontinued serving plaintiff no later than June 17, 1986, when plaintiff wrote the letter effectively discharging the firm. Plaintiff argued that defendants continued to serve him until October 9, 1986, when the probate court entered the order allowing withdrawal. Alternatively, plaintiff argued that the statute was tolled because of his insanity. See MCL 600.5851; MSA 27A.5851. In support of this theory, plaintiff presented the affidavit of clinical psychologist William L. Siff. The *315 trial court concluded that defendants discontinued serving plaintiff in June 1986 and that the Siff affidavit failed to establish that plaintiff was insane at the time his claim accrued.
On appeal, appellant first argues that the trial court erred in ruling that defendants discontinued serving plaintiff in June 1986. As in the trial court, appellant contends that service was not discontinued until the probate court entered its October 9, 1986, order allowing withdrawal. We find no error in the trial court's ruling. An attorney discontinues serving a client, for purposes of the statute of limitations, when the attorney is relieved of the obligation to serve by either the client or a court. See Berry v Zisman, 70 Mich App 376, 379; 245 NW2d 758 (1976); Basic Food Industries, Inc v Travis, Warren, Nayer & Burgoyne, 60 Mich App 492, 497-498; 231 NW2d 466 (1975). Here, plaintiff relieved defendants of their obligation to represent him when he ended their authority to do so by letter dated July 17, 1986. The statute requires no more.
Appellant argues that, plaintiff's discharge of defendants was not effective until October 9, 1986, under a clause in the parties' retainer agreement that states that "termination by Client pursuant to this paragraph shall not be effective until Client has approved a Stipulation and an Order allowing Attorney to withdraw as counsel of record in any legal proceedings within the scope of this Agreement." The argument is without merit. The parties' contract notwithstanding, an attorney's services are discontinued, for purposes of the statute of limitations, when the client or the court discharges the attorney. See Basic Foods, supra. See also Dowker v Peacock, 152 Mich App 669; 394 NW2d 65 (1986). Again, defendants were discharged, for purposes of the statute, in June 1986, *316 when plaintiff ended their authority to represent him. No additional court action was necessary to effectuate that discharge.
Appellant alternatively claims that summary disposition was premature because further factual development was required to determine if plaintiff's mental disturbance constituted insanity for purposes of the tolling statute, MCL 600.5851; MSA 27A.5851. We reject this argument. Plaintiff presented the affidavit of his expert as evidence of his insanity. The trial court considered the affidavit and found that plaintiff's claim of a "mental disturbance" was inadequate to toll the statute. No further factual development was necessary to reach this result.
Appellant also argues that, because plaintiff's complaint alleged violations of the Code of Professional Responsibility, the six-year period of limitation set forth at MCL 600.5807(8); MSA 27A.5807(8) or MCL 600.5813; MSA 27A.5813 should control. This argument also is without merit. Violations of the Code of Professional Responsibility provide the basis for a malpractice claim. See Sawabini v Desenberg, 143 Mich App 373, 385; 372 NW2d 559 (1985); Lipton v Boesky, 110 Mich App 589; 313 NW2d 163 (1981). The two-year statutory period of limitation therefore controls.
Appellant's final argument appears to be that the six-year statutory period of limitation for contract claims should control because plaintiff alleged that defendants improperly obtained a release from him. We disagree. Plaintiff's claim is not based on the release or any other contract, but instead is based on defendants' alleged mishandling of his affairs. The trial court properly determined that plaintiff's claim was for malpractice only and that the two-year statutory period of *317 limitation applied. Further, the court properly determined that plaintiff's action was untimely because it was filed more than two years after defendants discontinued serving plaintiff upon their discharge in July 1986.
Affirmed.
