OPINION
PER CURIAM:Appellants County of Imperial (County) and its officials challenge in this appeal a *1175preliminary injunction entered by the district court enjoining the County from enforcing a condition in a use permit held by one Donald C. McDougal. The condition prohibits the sale of water from McDougal’s land for use outside the County of Imperial. We affirm the preliminary injunction. To explain our holding, we include the pertinent historical facts leading up to the instant litigation.
McDougal, who is not a party in this appeal, owns certain real property in the County of Imperial in southern California. When he purchased the property, he also received a conditional use permit that allowed the commercial sale of water under the County’s zoning law. As a condition to this sale, the permit required that the water be sold only for use in Imperial County.
The previous owner made little use of the water sale rights, but McDougal increased the operation substantially. When the neighbors complained about the increased business activity, the County brought suit in the California Superior Court to enjoin McDougal’s water sales. The County alleged that McDougal was violating the conditional use permit by selling water for export outside the county and by employing large tank trucks which made noise and created fumes and dust.
The county was successful in its action and McDougal was enjoined from conducting a trucking operation of the type he started after purchase of the property. On appeal, the California Supreme Court partially affirmed the lower court’s holding. County of Imperial v. McDougal 19 Cal.3d 505, 138 Cal.Rptr. 472, 564 P.2d 14 (1977). The court upheld the export restriction in the conditional use permit by finding that it could not be challenged by McDougal. According to the court:
“[A] landowner or his successor in title is barred from challenging a condition imposed upon the granting of a special permit if he has acquiesced therein by either specifically agreeing to the condition or failing to challenge its validity, and accepted the benefits afforded by the permit (citations omitted). Thus, McDou-gal is estopped to assert that the prohibition . . . against the sale of water is invalid, and he is bound by the limitation.” 138 Cal.Rptr. at 476, 564 P.2d at 18.
The court specifically added, in a footnote to this quote, that in view of this holding it did not need to reach the constitutional question as to whether the permit’s prohibition on the export of water was valid. 138 Cal.Rptr. at 476, 564 P.2d at 18, n.3. Finally, the court reversed the trial court’s determination that the export limitation also prohibited McDougal from conducting a large-scale water sale operation. The court found the limitation not to be a regulation of land use but rather a condition upon the sale of a commodity, specifically a prohibition against the sale of water outside the County. 138 Cal.Rptr. at 477, 564 P.2d at 19.
Following this ruling, McDougal reopened the well. Pursuant to the California Supreme Court ruling upholding the export restriction, McDougal has, since the reopening, required each purchaser of water to sign an affidavit that the water being bought will be used only in Imperial County.
Appellees Munoz, Martinez and deLeon are Mexican merchants who had contracts for purchasing water from McDougal and were exporting the water to Mexico. When they returned to purchase water after the reopening of the well, McDougal refused to sell it to them because of the terms of his conditional use permit. Appellees then filed the instant action in federal district court and applied for a preliminary injunction. The injunction sought to keep the County from enforcing the out-of-county sale restriction on the ground that it violated the Commerce Clause, Article I, § 8, cl. 3, of the United States Constitution. The court ruled in appellees’ favor and enjoined the County from enforcing the no export term of the conditional use permit. The County appeals from this order.
The district court found the elements necessary for the granting of preliminary in-junctive relief — irreparable injury, probable *1176success on the merits,1 balance of equities in plaintiff’s favor, and presence of a public interest, see Benda v. Grand Lodge of Int’l Ass’n of Machinists & Aerospace Workers, 584 F.2d 308, 314-15 (9th Cir. 1978); Sierra Club v. Hathaway, 579 F.2d 1162, 1167 (9th Cir. 1978) — to be present in this case. The County does not challenge these findings, but argues instead that the California state court proceedings preclude the district court from issuing an injunction.
The County claims that under the Anti-Injunction Act, 28 U.S.C. § 2283, the existence of the state proceedings removes the district court’s power to issue the preliminary injunction. The Anti-Injunction Act provides:
“A court of the United States may not grant an injunction to stay proceedings in a State court except as expressly authorized by Act of Congress, or where necessary in aid of its jurisdiction, or to protect or effectuate its judgments.”
The district court found the Anti-Injunction Act not to be a bar because there was no pending state court proceeding which would be enjoined by the federal injunction. The County argues that there was still a pending proceeding in the enforcement of the California Supreme Court judgment. In Hill v. Martin, 296 U.S. 393, 56 S.Ct. 278, 80 L.Ed. 293 (1935), the United States Supreme Court stated:
“The prohibition of § 265 [the predecessor to the present 28 U.S.C. § 2283] is against a stay of ‘proceedings in any court of a State.’ That term is comprehensive. It includes all steps taken or which may be taken in the state court or by its officers from the institution to the close of the final process. ... It applies alike to action by the court and by its ministerial officers; applies not only to an execution issued on a judgment, but to any proceeding supplemental or ancillary taken with a view to making the suit or judgment effective.” 296 U.S. at 403, 56 S.Ct. at 282-83. (footnotes omitted).
Recently, in Vendo v. Lektro-Vend Corp., 433 U.S. 623, 97 S.Ct. 2881, 53 L.Ed.2d 1009 (1977), the Supreme Court applied this rule and overturned a lower federal court order which enjoined the collection of a state court money judgment.
In the instant case, however, there does not remain a last act necessary to effectuate the California Supreme Court judgment in County of Imperial v. McDougal. McDougal has complied with the California Supreme Court ruling that he cannot challenge the no export prohibition and refuses to sell water to those who would export it out of the County. No further proceedings or enforcement provisions of the California Supreme Court decision remain which may be affected by the district court injunction. Moreover, even if ongoing state proceedings remain, appellees here, not being parties in the state suit, may mount a constitutional challenge in federal court against the law which is the subject of these state proceedings. In Hale v. Bimco Trading Co., 306 U.S. 375, 59 S.Ct. 526, 83 L.Ed. 771 (1939), the Supreme Court held that third parties are not barred under the Anti-Injunction Act from challenging a statute on federal constitutional grounds when the statute is also under litigation in the state courts. Finally, the district court’s injunction did *1177not violate the rule that “the prohibition of § 2283 cannot be evaded by addressing the order to the parties” rather than to the state court. Atlantic Coast Line R. R. v. Bhd. of Locomotive Engineers, 398 U.S. 281, 287, 90 S.Ct. 1739, 1743, 26 L.Ed.2d 234 (1970). Appellees in their complaint sought to enjoin, in addition to the County and its officers, the California Superior Court from interfering with their right to purchase water from McDougal. The district court enjoined only the County and its officers and specifically added in its order that it “wishes to emphasize that this injunction pertains only to efforts by the County of Imperial to prohibit interstate commerce in the water.” (emphasis in original). The purpose of excluding the California Superi- or Court from the injunction, however, is not to avoid impermissibly the effects of the Anti-Injunction Act. Instead the injunction excludes the California courts because those courts are not now faced with the issue of the constitutionality of the zoning ordinance. The injunction is directed against the County, the only body claiming that the zoning ordinance and its conditional use permit are constitutional. In such circumstances, the district court’s issuance of the injunction against the County is not an attempt to circumvent the effect of the Anti-Injunction Act. We find that the Anti-Injunction Act does not bar the instant federal injunction.
The County’s additional argument, that the instant action is precluded by the res judicata effect of the state court proceedings, must also be rejected. Under the doctrine of res judicata, a final valid judgment rendered on the merits is binding on the parties or their privies so as to prevent them from relitigating the same case in either the same or a different forum. See Lawlor v. National Screen Service Corp., 349 U.S. 322, 326, 75 S.Ct. 865, 99 L.Ed. 1122 (1955); Hooker v. Klein, 573 F.2d 1360, 1367 (9th Cir. 1978). “Before the doctrine may apply, there must be (1) a valid, final judgment, (2) rendered on the merits, (3) a subsequent action involving the same parties or those in privity with them, (4) that is based on the same cause of action or claim.” Hooker v. Klein, 573 F.2d at 1367. The parties, focusing on the third element of this formula, have argued the question of whether appellees are in privity with McDougal so as to be bound by the California Supreme Court judgment against him. We need not reach this question, however, for we find that the other necessary elements of res judicata are missing here. A review of the California Supreme Court decision reveals that the issue of whether the County can constitutionally restrict the export of water was not reached by that court. See County of Imperial v. McDou-gal, 138 Cal.Rptr. at 476, 564 P.2d at 18, n.3. There is thus no valid final judgment on the merits existing as to the cause of action in the instant case. As a result, the California Supreme Court decision would not have a res judicata effect in a case where proper parties, including even those in privity with McDougal, are directly challenging the permit’s validity on constitutional grounds. Since the doctrine of res judicata extends only to issues that have been litigated on their merits, see Smith v. Lujan, 588 F.2d 1304, 1307 (9th Cir. 1979); Hooker v. Klein, 573 F.2d at 1367, it is not applicable in this case.
The judgment of the district court is AFFIRMED.
. The district court found the restriction on the sale of water outside Imperial County to be on its face a direct prohibition against interstate commerce in the water. Consequently, the court found it likely that appellees would succeed on the merits of their contention that the restriction in the use permit violates the Commerce Clause.
While we do not reach the merits of the Commerce Clause question, we note that subsequent to the issuance of the district court injunction, the United States Supreme Court decided Hughes v. Oklahoma,—U.S.—, 99 S.Ct. 1727, 60 L.Ed.2d 250 (1979). In Hughes v. Oklahoma, the Court struck down an Oklahoma statute which prohibited the export outside of the State of minnows procured from state waters. The Court found that the statute “on its face discriminates against interstate commerce” and that “[sjuch facial discrimination by itself may be a fatal defect, regardless of the State’s purpose . . .. At a minimum such facial discrimination invokes the strictest scrutiny of any purported legitimate local purpose and of the absence of nondiscriminatory alternatives.” 99 S.Ct. at 1737.
The district court’s decision regarding the merits of the Commerce Clause question should be made in light of Hughes v. Oklahoma.