
18 Cal.3d 832 (1977)
558 P.2d 867
135 Cal. Rptr. 781
SOUTH COAST REGIONAL COMMISSION, Plaintiff and Appellant,
v.
HAROLD GORDON et al., Defendants and Respondents.
Docket No. L.A. 30632.
Supreme Court of California.
January 6, 1977.
*833 COUNSEL
Evelle J. Younger, Attorney General, Carl Boronkay, Assistant Attorney General, Alan Robert Block and David R. Goldman, Deputy Attorneys General, for Plaintiff and Appellant.
Fadem, Berger & McIntire, Fadem, Berger & Stocker and Michael M. Berger for Defendants and Respondents.
Fulop, Rolston, Burns & McKittrick, Lawrence R. Resnick and Kenneth B. Bley as Amici Curiae on behalf of Defendants and Respondents.
OPINION
MOSK, J.
On May 15, 1973, the South Coast Regional Commission (the commission) filed an action against Harold Gordon, alleging that he was constructing a home and ancillary buildings in the permit area of the coastal zone without a permit, in violation of the Coastal Zone *834 Conservation Act. (Pub. Resources Code, § 27000 et seq.)[1] The complaint sought an injunction to restrain further construction without a permit, and monetary penalties as set forth in the act.[2] The trial court issued a preliminary injunction, and Gordon filed an answer alleging that he was not required to obtain a permit from the commission because he had a vested right to complete the structures.[3]
Gordon had not applied to the commission for an exemption from the permit requirements of the act, and the commission filed a motion for summary judgment on that ground. The trial court denied the motion, and the action proceeded to trial to determine whether Gordon had a vested right to complete the structures. The court found that Gordon had a vested right, and awarded him attorney's fees against the commission.
On this appeal from the ensuing judgment, the commission contends that the trial court erred in ruling upon the merits of Gordon's vested rights claim in the absence of a prior determination by the commission on that question, in finding for Gordon on the merits of that claim, and in awarding attorney's fees in favor of Gordon.
(1) We conclude, consistent with our holding in State of California v. Superior Court (1974) 12 Cal.3d 237 [115 Cal. Rptr. 497, 524 P.2d 1281] (hereinafter Veta), that Gordon was required to present his exemption claim to the commission as a condition of raising the claim in the trial court. In view of this conclusion, we do not reach the two additional issues raised by the commission.
*835 On January 22, 1973, Gordon obtained a building permit from the county of Los Angeles to construct a single-family dwelling, a carport, guesthouse and cabana on his property in Malibu. On January 30, he obtained a permit for a swimming pool. Prior to February 1, he built 12 foundation caissons and filled them with concrete, excavated for foundation grade beams, and performed rough excavation for the swimming pool.
Construction proceeded until May 15, 1973, when the commission filed the complaint which initiated this action, charging that Gordon was performing development in the coastal zone without a permit. After the trial court granted a preliminary injunction, Gordon filed an answer, asserting as an affirmative defense that he was exempt from the permit requirement on the ground he had a vested right to complete his development because he had performed substantial construction before February 1, 1973. Nevertheless, Gordon applied to the commission for a construction permit  not for exemption from permit requirements  after the preliminary injunction was issued, but before trial. The permit was denied, and Gordon did not seek a review of this ruling. Some months before the trial commenced, the commission made a motion for summary judgment, contending that Gordon's failure to seek an exemption determination from the commission precluded him from asserting his vested rights claim as a defense in the trial court. As we have seen, that motion was denied, and the case proceeded to trial on the vested rights issue.
The statewide coastal commission has enacted regulations governing claims of exemption. (Cal. Admin. Code, tit. 14, § 13700 et seq.) They provide that a person claiming an exemption shall file a claim therefor with the regional commission, providing all information necessary to support his claim. (Tit. 14, § 13701.) A public hearing on the claim is held as soon as possible, and claims of exemption have priority on the calendar. (Tit. 14, §§ 13702, 13703.) A regional commission's determination is appealable to the statewide commission (tit. 14, § 13902), and a final determination granting a claim of exemption constitutes an acknowledgment that no commission permit is required for further development (tit. 14, § 13707).
In Veta we held that the commission was acting within the scope of its powers in enacting these regulations and that a developer must secure a determination that he has an exemption as a predicate to seeking such a *836 judgment from a court. We declared that the mere fact the concept of vested rights is rooted in the Constitution does not deprive the commission of the power to make the initial determination whether an exemption is warranted, so long as ultimate judicial review is provided. Finally, we observed that the commission had passed upon a large number of vested rights claims and that orderly procedure requires that it be afforded the opportunity to make exemption determinations before judicial relief is sought. In our view, the holding in Veta is controlling in the present case, and Gordon was required to present his claim of exemption to the commission before raising the matter in the trial court.
He contends, however, that the rationale of Veta is inapplicable here because in Veta the developer himself sought equitable relief, whereas Gordon is merely raising his exemption claim as a defense to the commission action against him. He asserts that there is no requirement that administrative remedies be exhausted where, as here, a party raises his vested rights claim as a defense in an enforcement action against him.
We do not agree. We observe initially the situation presented here does not involve the usual context in which the exhaustion doctrine is raised, i.e., the possibility of premature interruption of proceedings before an administrative body, such as the failure to appeal an administrative determination to a reviewing board. Rather, there have been no administrative proceedings regarding exemption because Gordon has failed to make application to the commission, although Veta compels him to do so as a predicate to a determination of that claim by a court. Nor is Gordon challenging the validity of the statutes or regulations under which the commission operates. Instead, he attempts to raise by way of defense a matter which is initially committed to the commission's determination, and which he has not presented to that agency. The situation is analogous to one in which a defendant in an action alleging a violation of zoning laws asserts by way of defense that he is entitled to a variance, even though he did not apply to the appropriate body for a variance, as required by law.
The decisions cited by Gordon in support of his position are distinguishable. In McKart v. United States (1969) 395 U.S. 185 [23 L.Ed.2d 194, 89 S.Ct. 1657], the United States Supreme Court held that a draft registrant's failure to appeal his reclassification to 1-A by his local draft board to an appeal board did not prevent him from raising the invalidity of the classification as a defense in an action against him for *837 failing to report for induction. The court reasoned that the application of the exhaustion doctrine in a criminal prosecution can be harsh, that allowing all similarly situated registrants to bypass administrative appeal would not seriously impair the functioning of the selective service system, and that the contentions which the registrant sought to advance involved only issues of statutory interpretation rather than questions of fact. And in United States v. McCrillis (1st Cir.1952) 200 F.2d 884, it was held that a landlord was not required to challenge before an administrative agency the validity of an order setting a maximum rent as a condition to raising that issue in the trial court in an action by the government alleging that he was charging more than the rent set by the administrative order.[4]
In neither of the foregoing cases did the defendant bypass the administrative agency altogether, as did Gordon here, but obtained an adverse determination from the agency on the substance of the issue raised as a defense prior to the commencement of court action.
The present situation appears to be more closely analogous to McGee v. United States (1971) 402 U.S. 479 [29 L.Ed.2d 47, 91 S.Ct. 1565], relied upon by the commission. In McGee, a registrant had applied for conscientious objector status but refused to provide his local draft board with information upon which his claim was based, and he failed to appeal the local board's decision. The high court held that because of his failure to appear before his local board to assert his claim of exemption or to take an administrative appeal, he was barred from raising his entitlement to conscientious objector status as an affirmative defense in an action against him for violating the Selective Service Act. The court justified its holding on the ground that whether a person is a conscientious objector depends upon the careful gathering and analysis of relevant facts, that the registrant's conduct had deprived the selective service system of the opportunity to fully develop the facts, and that there was a danger that others would deliberately evade the administrative process if the registrant were allowed to press his claim as a defense before a court.
*838 Here, as in McGee, the question of entitlement to an exemption involves the marshalling of facts, and if the necessity for the commission's determination is not upheld it is likely that other developers will sense the advantage in bypassing commission exemption proceedings. If developers were allowed to resort to the courts in the first instance, it would not only frustrate one of the underlying purposes of the exhaustion doctrine, i.e., the need for judicial intervention might be obviated by the outcome of the administrative proceedings, but would also reward developers who made no attempt to fulfill the requirements of the act and the regulations, while penalizing those who made a good faith effort to comply. It would obviously be discriminatory to allow Gordon, who did not apply either for a permit or an exemption prior to institution of the present action but simply continued his building activities after February 1, 1973, to avoid exemption proceedings before the commission, while compelling the builder in Veta, who had applied for but was refused a permit, to obtain a commission determination of exemption as a predicate to raising that issue in court.[5]
Finally defendant contends it is futile to now require him to seek an exemption from the commission since the commission has already reached its conclusion that he is not entitled to an exemption, and this determination has been reversed by the trial court. However, the fact that the Attorney General, as the representative of the commission, has taken the position on its behalf in this litigation that Gordon is not entitled to an exemption cannot be deemed the equivalent of a determination to the same effect by a vote of the commission after a public hearing. Indeed, the exhaustion doctrine has been applied even under circumstances in which the government has conceded in court that the defendant would have prevailed if he had exhausted his administrative remedies. Thus, in McGee, the government admitted that the registrant would have been entitled to an exemption if he had appeared before the draft board. The Supreme Court pointed out, however, that the exhaustion requirement "`cannot properly be limited to those *839 persons whose claims would fail in court anyway.'" (402 U.S. at p. 490 [29 L.Ed.2d at p. 56].)
The trial court awarded more than $23,000 in attorney's fees to Gordon as the prevailing party in this litigation, pursuant to section 27428.[6] While we do not pass upon the propriety of awarding attorney's fees to a prevailing defendant under that section, it is clear that the trial court erred in considering the merits of Gordon's claim of vested rights and the judgment in his favor must be reversed. It follows that since Gordon is not the prevailing party in the action, he is not entitled to attorney's fees.
The judgment is reversed.
Wright, C.J., McComb, J., Tobriner, J., Sullivan, J., Clark, J., and Richardson, J., concurred.
Appellant's petition for a rehearing was denied February 3, 1977.
NOTES
[1]  All references will be to the Public Resources Code unless otherwise noted. Section 27104 defines the permit area. Section 27400 provides, "On or after February 1, 1973, any person wishing to perform any development within the permit area shall obtain a permit authorizing such development from the regional commission and, if required by law, from any city, county, state, regional or local agency...."
[2]  Section 27500 provides, "Any person who violates any provision of this division shall be subject to a civil fine not to exceed ten thousand dollars ($10,000)."

Section 27501 provides, "In addition to any other penalties, any person who performs any development in violation of this division shall be subject to a civil fine not to exceed five hundred dollars ($500) per day for each day in which such violation persists."
[3]  Section 27404 states, "If, prior to November 8, 1972, any city or county has issued a building permit, no person who has obtained a vested right thereunder shall be required to secure a permit from the regional commission.... Any such person shall be deemed to have such vested rights if, prior to November 8, 1972, he has in good faith and in reliance upon the building permit diligently commenced construction and performed substantial work on the development and incurred substantial liabilities for work and materials necessary therefor...." As originally enacted, the section contained the words "effective date of this division" in place of the date November 8, 1972, in both places in the statute where that date appears.
[4]  Gordon relies also upon San Diego Coast Regional Com. v. See the Sea, Limited (1973) 9 Cal.3d 888 [109 Cal. Rptr. 377, 513 P.2d 129], in which we affirmed a judgment of the trial court that the defendant had acquired a vested right to complete his development. There is no indication on the face of the opinion whether the developer had applied for a declaration of exemption from the commission. Assuming that he did not, the case provides little support for Gordon's position since the opinion makes no mention of the issue. When the question of the necessity for a prior commission determination of exemption arose the following year, we squarely decided in Veta that such a declaration was required as a predicate to raising the matter in the trial court.
[5]  Gordon's project, which he began building only a few days before February 1, 1973, was 80 percent completed by the time the commission filed this action, after complaints received from his neighbors. From the beginning of the proceedings, Gordon claimed that it would be dangerous to prohibit him from completing the structures because in their condition on the date the action was filed they represented an attractive nuisance and a fire hazard, and there was a danger of theft, vandalism, and damage from the elements. Eventually, these arguments prevailed and, although not entirely clear from the record, the structures appear to have been completed; therefore only the monetary penalties are now in issue.
[6]  Section 27428 provides, "Any person who prevails in a civil action brought to enjoin a violation of this division or to recover civil penalties shall be awarded his costs, including reasonable attorneys fees."
