
45 Cal.2d 629 (1955)
FRANK C. MOSIER et al., Appellants,
v.
DEWEY MEAD et al., Respondents.
Sac. No. 6577. 
Supreme Court of California. In Bank.  
Nov. 29, 1955.
 Sutter, Elledge & Carter for Appellants.
 Daniel E. O'Connell and Frank B. Collier for Respondents.
 SPENCE, J.
 Plaintiffs and cross-defendants in this quiet title action appeal from a decree adjudging that defendants and cross-complainants are the owners of an easement over plaintiffs' land on which is constructed a flood-control levee, and enjoining plaintiffs from interfering in any manner with defendants' lawful use and enjoyment thereof. The cause was submitted upon an agreed statement of facts.
 In 1938 an expensive levee was constructed upon plaintiffs' land to protect a county highway and the property of defendants and other landowners from flood waters of the San Joaquin River. Plaintiffs' predecessor in interest consented to this work, and thereafter filed a claim for $1,500 with the board of supervisors for damages and for compensation for an easement to the 23 acres occupied by the levee. The stipulated facts do not show what disposition was made of this claim.
 Construction work was done by the threatened landowners and county employees, the latter working under the direction of a county supervisor, using county equipment and being paid with county funds. The board of supervisors has never approved the project, and the county does not claim any easement or right to maintain the levee. Plaintiffs acquired the property involved in 1947.
 The levee lies entirely within the boundaries of the Sacramento and San Joaquin Drainage District. Plans for its construction and maintenance were never approved by the State Reclamation Board. Statutes in force when the work was done, which since have been incorporated without substantial change in the Water Code, required the board's prior approval of every plan of reclamation calling for construction and maintenance of a levee (now Wat. Code,  8710) and prohibited the doing of any work pursuant to such a plan without the board's permission ( 8711). It was further *631 provided that "[t]he doing of any act or construction of any work mentioned in this article, or permitting the work to remain after such construction, without the permission of the board and in violation of any of the provisions of this article, is a public nuisance, and the board may commence and maintain suit in the name of the people of the State for the prevention or abatement of the nuisance" ( 8719). Moreover, any person violating these provisions was declared guilty of a misdemeanor ( 8720).
 The levee was so located upon plaintiffs' property that it separated from their irrigation facilities about 100 acres of tillable farm land, thus requiring the construction of additional facilities. The present dispute arose when plaintiffs sought to remove the levee. Both prior to the filing of this action to quiet title (May 6, 1952) and since, plaintiffs entered upon the levee, removed dirt therefrom and "thereby destroyed substantially all of [the] levee." It was stipulated that if "defendants and cross-complainants own the easement and levee constructed thereon, as alleged in their cross-complaint, they have been damaged" but that "in lieu of damages," the court might issue a "mandatory injunction requiring plaintiffs and cross-defendants" to restore the levee.
 The trial court's decree declared defendants to be the owners of an easement in the realty, for purposes of flood control and protection of property in the vicinity, with the right to reconstruct and maintain the levee, as provided by law. As stated by the trial judge in his decision, the exercise of this latter right would require the acquisition of the necessary permit required by law to be obtained from the Reclamation Board. The decree also enjoined plaintiffs from claiming any right, title, or interest in the easement adverse to defendants. The decree particularly described defendants' easement by metes and bounds; but it made no award of damages in their favor nor did it grant a mandatory injunction directing plaintiffs to restore the levee.
 In attacking the decree, plaintiffs' argument rests primarily upon the premise that a quiet title action is essentially equitable in nature (Newport v. Hatton, 195 Cal. 132, 153 [231 P. 987]; Angus v. Craven, 132 Cal. 691, 696- 697 [64 P. 1091]), and a "court of equity will not allow itself to become a handmaid of iniquity of any kind." (Domenigoni v. Imperial Live Stock etc. Co., 189 Cal. 467, 475 [209 P. 36].) As above recited from the statement of facts, it is admitted that neither the plans for the levee nor its maintenance were approved by *632 the Reclamation Board, either before or after its construction. Accordingly, plaintiffs argue that quieting title to defendants' easement constitutes affirmative sanction of a levee admittedly constructed in violation of a penal statute, an act denominated a misdemeanor, and its continued maintenance declared a public nuisance. They further argue that as landowners, they would be liable to suit, and possibly criminal prosecution, for permitting the structure to remain on their property. While plaintiffs cite a number of cases from this and other jurisdictions stating the general salutary principles guiding courts of equity in their proper disposition of controverted issues, they do not apply to the precise situation here.
 [1] Plaintiffs misconstrue the effect of the trial court's decree. The court did not determine that defendants were entitled to maintain or repair the levee without sanction or approval of the Reclamation Board. Rather, the decree simply declares that defendants "... were during all the times herein mentioned, and now are, the owners of an easement in, on, over and across the hereinafter described real property, on which is constructed a levee. elip;" Thus, as stated by the trial judge in his decision, defendants had an easement for the construction of a levee as actually constructed, but since the levee was illegally constructed, they had no standing in a court of equity for damages or injunction.
 [2] An easement is generally defined as an "interest in land created by grant or agreement, express or implied, which confers a right upon the owner thereof to some profit, benefit, dominion, or lawful use out of or over the estate of another." (Los Angeles etc. Co. v. Muir, 136 Cal. 36, 48 [68 P. 308]; see 17 Cal.Jur.2d,  2, p. 89; Wright v. Best, 19 Cal.2d 368, 381 [121 P.2d 702].) [3] There is no reason why defendants could not have acquired by express grant an easement to maintain a levee on plaintiffs' property. The exercise of such express grant of an easement for a use which could be made legal by obtaining the sanction of the specified state agency--that is, construction and maintenance of a levee with permission of the State Reclamation Board--would not be a grant for an illegal purpose. That being true, there could likewise be an implied grant of an easement by plaintiffs' predecessor to defendants for the same purpose; and such seems to be the case here.
 [4] Whether an easement arises by implication depends on the intent of the parties, and the court will take into consideration *633 the circumstances attending the transaction, the particular situation of the parties, and the state of the thing granted. (28 C.J.S.,  30, p. 686.) [5] The effect of section 806 of the Civil Code is to establish intent as the criterion for determining the "extent of a servitude," and this is in accord with the rationale of the rules governing easements by implication. (Fristoe v. Drapeau, 35 Cal.2d 5, 9 [215 P.2d 729].) [6] Here it cannot be disputed that plaintiff's predecessor recognized and consented to defendants' easement on her property for the purpose of constructing and maintaining a levee, for after its construction she presented her claim to the county, reading in part as follows: "For damages for building levee across my ranch and for an easement 200 feet wide running East of Crows Landing Road and 100 feet across North side along highway, being 23 acres, more or less." In view of this evidence of intent and the situation of the parties, the court properly sustained defendants' claim to an easement, upon the basis of an implied grant, for the purpose of constructing and maintaining the levee "as provided by law," including the acquisition of the necessary permit from the Reclamation Board.
 Having concluded that the trial court properly determined that defendants had a right to an easement by implied grant, it becomes unnecessary to consider whether defendants could have acquired a similar right by prescription when the construction and maintenance of the levee without the approval of the Reclamation Board amounted to a public nuisance and a misdemeanor.
 The judgment is affirmed.
 Gibson, C.J., Shenk, J., Traynor, J., Schauer, J., and McComb, J. pro tem.,  [fn. *] concurred.
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
