
163 Cal.App.4th 826 (2008)
PUEBLO RADIOLOGY MEDICAL GROUP, INC., Plaintiff and Appellant,
v.
J. DALTON GERLACH et al., Defendants and Respondents.
No. B194106.
Court of Appeals of California, Second District, Division Six.
June 4, 2008.
*827 McCarthy & Kroes, R. Chris Kroes and Scott London for Plaintiff and Appellant.
Fell, Marking, Abkin, Montgomery, Granet & Raney, Craig S. Granet and Jennifer Gillon Duffy for Defendants and Respondents.

OPINION
PERREN, J.
Appellant Pueblo Radiology Medical Group, Inc. (Pueblo), filed a breach of contract action against Vitascan, Inc. (Vitascan), and respondents J. Dalton Gerlach (Gerlach) and Daniel Parker (Parker). The allegations against Gerlach and Parker were that they were the alter egos of Vitascan. The trial court found they were not and judgment was entered accordingly, including an award of attorney fees to them under Civil Code section 1717.[1] Pueblo asserts the award of fees was premature because there has been no determination of whether a breach of contract occurred. We disagree. The action was on the contract. The trial court's finding that Gerlach and Parker were not personally liable was a favorable termination of the case as to each of them as individuals. Accordingly, we affirm.

FACTUAL AND PROCEDURAL HISTORY
Pueblo entered into a contract with Vitascan to provide interpretation services of imaging scans from the Vitascan mobile Imatron electron beam tomography scanner. Gerlach signed the contract on behalf of Vitascan. Gerlach was Vitascan's president, and Parker was Vitascan's secretary. Gerlach and Parker were the sole shareholders.
The contract was for the period from June 1, 2001, to December 30, 2003. The contract contained an attorney fee clause as follows: "If litigation or *828 arbitration shall be required to enforce this Agreement or address any dispute arising hereunder, the prevailing party, as determined by the court or arbitrator in the matter, shall be entitled to court or arbitration costs and reasonable attorneys' fees from the other party(ies)."
In mid-March 2002, Vitascan advised Pueblo that its services were no longer needed. In June 2002, Pueblo filed a complaint for damages for breach of contract, common counts and an accounting, naming Vitascan, Gerlach and Parker as defendants. The complaint alleged that Gerlach and Parker were the alter egos of Vitascan. Vitascan ceased operations in September 2003 and filed for bankruptcy in March 2004.
On July 13, 2004, Gerlach and Parker filed a motion to bifurcate the breach of contract claim from the alter ego issue. Pueblo opposed the motion. The trial court granted the motion and heard the alter ego issue first. On March 16, 2006, after a 15-day bench trial, the court issued a 54-page statement of decision finding in favor of Gerlach and Parker on the alter ego issue. Subsequently, the court granted their motion for attorney fees under section 1717 in the amount of $250,000.
On appeal, Pueblo does not challenge the trial court's finding on the alter ego issue; its sole argument is that the trial court's award of attorney fees was premature because the breach of contract issue had not been decided.

DISCUSSION
We review a determination of the legal basis for an award of attorney fees de novo as a question of law. (Dell Merk, Inc. v. Franzia (2005) 132 Cal.App.4th 443, 450 [33 Cal.Rptr.3d 694].)
Section 1717, subdivision (a) states in part: "In any action on a contract, where the contract specifically provides that attorney's fees and costs, which are incurred to enforce that contract, shall be awarded either to one of the parties or to the prevailing party, then the party who is determined to be the party prevailing on the contract, whether he or she is the party specified in the contract or not, shall be entitled to reasonable attorney's fees in addition to other costs."
Both sides rely upon Reynolds Metals Co. v. Alperson (1979) 25 Cal.3d 124 [158 Cal.Rptr. 1, 599 P.2d 83] as dispositive. We agree but conclude that Gerlach and Parker had the better argument and that the attorney fee award was not premature. In Reynolds, the plaintiff brought an action against two shareholders and directors of two bankrupt corporations seeking to hold them personally liable on an alter ego theory for debts the corporation owed. One *829 of the claims was based on promissory notes which included a provision for attorney fees. The individual defendants, however, had not signed the notes. They prevailed and sought attorney fees. Our Supreme Court held the defendants were entitled to fees under the reciprocity provision of section 1717. The court reasoned: "Had plaintiff prevailed on its cause of action claiming defendants were in fact the alter egos of the corporation [citation], defendants would have been liable on the notes. Since they would have been liable for attorney's fees pursuant to the fees provision had plaintiff prevailed, they may recover attorney's fees pursuant to section 1717 now that they have prevailed." (Reynolds Metals Co., at p. 129.)
Pueblo contends that Reynolds is distinguishable because attorney fees were awarded only after the breach of contract claim was decided and the plaintiff was found to be liable. We disagree. The award of attorney fees under section 1717 was proper. The Supreme Court said, "Had plaintiff prevailed on its cause of action claiming defendants were in fact the alter egos of the corporation [citation], defendants would have been liable on the notes." (Reynolds Metals Co. v. Alperson, supra, 25 Cal.3d 124, 129, italics added.) The fact that the breach of contract claim and alter ego issue were tried together is irrelevant. The determinative fact was that the individual defendants had prevailed on the alter ego issue. (Id. at p. 127 ["After lengthy trial, the court rejected the `alter ego' theory advanced by plaintiff, absolving defendants from personal liability for the obligations of [the corporations]" and "granted defendants $80,500 in attorney's fees"].) The trial court's determination that respondents were not the alter egos of the corporation effectively ended the case as to them. They were entitled to recover attorney fees under the contract.[2]
(1)The award of attorney fees in Reynolds is an application of the accepted rule that attorney fees may be awarded to a defendant when a final determination has been made in the defendant's favor. (See, e.g., First Security Bank of Cal. v. Paquet (2002) 98 Cal.App.4th 468, 475 [119 Cal.Rptr.2d 787] [where an action is final as to defendants in their individual capacities, trial court properly determined they had prevailed in the action for purposes of awarding § 1717 attorney fees].)
*830 Pueblo's argument that the court erred by failing to apportion attorney fees between the contract and non-contract claims disregards the fact that the alter ego issue was essential to its claim. It could not reach the contract claim against respondents without piercing the corporate veil. The claim of "alter ego" was a step directly implicated in the contract action. Had it prevailed on this claim, the ensuing litigation on the contract would unquestionably have entitled the prevailing party to attorney fees, a fact conceded by Pueblo at oral argument. The mere fact that for judicial economy the alter ego issue was bifurcated in no way alters the nature of the action.
The judgment is affirmed. Respondents shall recover costs and reasonable attorney fees to be decided by the trial court.
Gilbert, P. J., and Yegan, J., concurred.
NOTES
[1]  All statutory references are to the Civil Code.
[2]  Similarly, in Profit Concepts Management, Inc. v. Griffith (2008) 162 Cal.App.4th 950 [76 Cal.Rptr.3d 396], Profit sued Griffith, an Oklahoma resident, in California for breach of a contract that included a provision for the award of attorney fees. Griffith's motion to quash service was granted and he was awarded attorney fees under section 1717. Like appellant in the instant matter, Profit contended that there was no prevailing party on the contract. Our colleagues in the Fourth District concluded, however, that the only action before the court was on the contract and that, having succeeded in quashing the summons and being dismissed from the case, Griffith was the prevailing party and was entitled to attorney fees.
