A plaintiff has the right to voluntarily dismiss, with or without prejudice, all or any part of an action before the commencement of trial. Civ. Proc. § 581. A plaintiff that fears losing may simply dismiss his lawsuit to prevent the defendant from obtaining an award of contractual attorney’s fees. Civ. Code § 1717 ("[w]here an action has been voluntarily dismissed…there shall be no prevailing party.") But, plaintiff’s right to cut and run is not absolute.
In Bank of America v. Mitchell, 204 Cal.App.4th 1199 (2012), the trial court sustained defendant’s demurrer without leave to amend. Two days later, the bank filed a voluntary dismissal with prejudice. It then opposed defendant’s fee motion on the ground that there could be no prevailing party because it had dismissed the action with prejudice. However, the trial court vacated the bank’s dismissal and awarded attorney fees to the defendant. The court of appeal affirmed. By sustaining the demurrer without leave to amend, the trial court had decided the dispute on the merits. Therefore, the bank no longer had the right to voluntarily dismiss under § 581.