
171 Cal.App.3d 312 (1985)
217 Cal. Rptr. 208
ERVIN D. VARWIG, Plaintiff and Appellant,
v.
ELIAS N. LEIDER et al., Defendants and Respondents.
Docket No. A020888.
Court of Appeals of California, First District, Division Two.
August 21, 1985.
*313 COUNSEL
Sidney F. De Goff for Plaintiff and Appellant.
Edward A. Hume for Defendants and Respondents.
*314 OPINION
SMITH, J.
Appellant Ervin D. Varwig brought suit against respondents Elias N. and Louise R. Leider, and the Crystal Springs Golf Club, Inc. in 1976. Varwig alleged that he and his wife owned a piece of property in Lake County. They used this property to secure a $40,000 loan from the Leiders. The Leiders agreed to make the loan and to waive interest thereon in exchange for Varwig's promise to do some work free of charge on the Crystal Springs golf course. This work involved excavating and grading the site of a proposed driving range, repairing a parking lot, and correcting earth slippage at the 6th tee of the golf course.
In his suit Varwig sought to recover the deed on the Lake County property and the value of the goods and services he had provided to the Crystal Springs Golf Club. He set the value of the work performed at in excess of $120,000. The Leiders cross-complained for payment of the $40,000 they had lent Varwig.
At a pretrial conference on January 30, 1980, Varwig agreed to cancel all liens that had been filed against the judgment in the action and to pay all bills that had been submitted to him on the golf course project. He was to provide proof of cancellation of the liens and proof of payment to respondents within 30 days. At that time respondents would be obligated to pay Varwig $75,000. Of this amount, $40,000 would be used to cancel Varwig's note to the Leiders and the balance of $35,000 would be paid in cash to Varwig and his attorney. No proof of cancellation of the liens or of payment of the bills was forthcoming.
The underlying lawsuit was taken off calendar after the parties agreed to settle their claims. It remained off calendar until 1982 when respondents moved to dismiss the action pursuant to Code of Civil Procedure section 583, subdivision (b).[1] Varwig opposed the motion to dismiss and argued that the settlement disposed of all issues to be tried and that dismissal under section 583, subdivision (b) therefore was inappropriate. The trial court granted the motion to dismiss and Varwig appeals from the dismissal.
(1a) The trial court as a rule has a mandatory duty to dismiss an action not brought to trial within five years. (Crown Coach Corp. v. Superior *315 Court (1972) 8 Cal.3d 540, 546 [105 Cal. Rptr. 339, 503 P.2d 1347].) The statute is intended to prevent unreasonable delay in the prosecution of cases pending in the trial courts. (Id., at pp. 546-547.) A matter is considered to have been brought to trial when the jury is sworn or when the first witness is sworn in a nonjury trial. (Hartman v. Santamarina (1982) 30 Cal.3d 762, 765-767 [180 Cal. Rptr. 337, 639 P.2d 979, 32 A.L.R.4th 833].) A matter has also been brought to trial when it has been "brought to a stage where final disposition is to be made of it." (Italics omitted.) (McDonough Power Equipment Co. v. Superior Court (1972) 8 Cal.3d 527, 532 [105 Cal. Rptr. 330, 503 P.2d 1338], quoting Berri v. Superior Court (1955) 43 Cal.2d 856, 858-860 [279 P.2d 8].)
Varwig claimed that the parties had reached a compromise and had agreed not to proceed with the lawsuit. Such compromises are favored as a matter of public policy because the time and expense of a trial can be avoided if the parties settle the litigation. (Gopal v. Yoshikawa (1983) 147 Cal. App.3d 128, 131-132 [195 Cal. Rptr. 36].) (2) Parties to a compromise agreement have been allowed to enforce their settlements by making a motion to have judgment entered in the underlying lawsuit in accordance with the terms agreed to by the parties. This procedure furthers the public policy favoring settlements by removing the necessity of the filing of a separate lawsuit to enforce the parties' agreement. (Id., at p. 132.) The right to have judgment entered on a compromise agreement was expanded by the enactment of section 664.6 which provides: "If parties to pending litigation stipulate, in writing or orally before the court, for settlement of the case, or part thereof, the court, upon motion, may enter judgment pursuant to the terms of the settlement." (Corkland v. Boscoe (1984) 156 Cal. App.3d 989, 993-994 [203 Cal. Rptr. 356].)
(1b) However, until a party seeks to enforce a compromise agreement and to have judgment entered thereon, the underlying lawsuit has not finally been disposed of although the parties may in fact be bound by a valid and enforceable settlement contract. Consequently, if the lawsuit is not brought before the trier of fact or if judgment is not entered on the compromise agreement within five years of the filing of the action, the provisions of section 583, subdivision (b) will apply, and as a general rule the lawsuit must be dismissed.
We are aware of the holding to the contrary in Gorman v. Holte (1985) 164 Cal. App.3d 984, 987-989 [211 Cal. Rptr. 34]. It appears that appellant in Gorman had moved to have judgment entered on a stipulated settlement before respondent moved to dismiss the action pursuant to section 583, subdivision (b). While reversal of the trial court's dismissal may have been appropriate based on those facts, we disagree with the holding that a settlement *316 agreement will as a general rule preclude the application of the time constraints set forth in section 583, subdivision (b). A dismissal under that section will not, as is suggested in Gorman, adversely affect the agreement between the parties. Such agreements are contracts and are governed by the general principles of contract law. (T.M. Cobb Co. v. Superior Court (1984) 36 Cal.3d 273, 280 [204 Cal. Rptr. 143, 682 P.2d 338].) The parties will retain their right to seek to specifically enforce their settlement contract even if the underlying lawsuit is dismissed. It is true that, if a separate lawsuit to enforce the agreement is filed, the purpose of encouraging settlement (e.g., to avoid the time and expense involved in a trial) will be defeated. The policies favoring settlement must, however, be balanced against the expressed desire of the Legislature to have litigation resolved in a reasonably expeditious manner. This purpose would be defeated if a lawsuit must remain pending before the trial court when the parties have reached a compromise agreement but have chosen not to enter judgment on it in a timely fashion.
Varwig did not move to enforce the compromise agreement he allegedly reached with respondents. He failed to bring his lawsuit to trial within five years of its filing, and he failed to present an acceptable reason for not bringing the matter to trial. The trial court correctly dismissed Varwig's suit without considering the validity of the alleged compromise agreement and we affirm that ruling.
The judgment is affirmed.
Kline, P.J., and James, J.,[*] concurred.
NOTES
[1]  All further statutory references are to the Code of Civil Procedure. Section 583, subdivision (b) provides: "Any action heretofore or hereafter commenced shall be dismissed by the court in which the same shall have been commenced or to which it may be transferred on motion of the defendant, after due notice to plaintiff or by the court upon its own motion, unless such action is brought to trial within five years after the plaintiff has filed his action, except where the parties have filed a stipulation in writing that the time may be extended."
[*]   Assigned by the Chairperson of the Judicial Council.
