*67Opinion
HULL, J.Nine years after the City of Stockton (City) initiated eminent domain proceedings to acquire real property owned by Andrew C. Cobb, as trustee of the Andrew C. Cobb 1992 Revocable Trust (the Trust), and after the City constructed a public roadway across the condemned property, the trial court dismissed the action for lack of prosecution (Code Civ. Proc., § 583.360). Plaintiff, Michael A. Cobb, as successor trustee, then initiated this action in inverse condemnation to collect for the taking of the property by virtue of the extant roadway.
The City demurred to the complaint, arguing the inverse condemnation claim is time-barred, inasmuch as the taking occurred more than five years before the complaint was filed. The trial court agreed, sustained the demurrers without leave to amend, and entered judgment for the City. Plaintiff appeals.
We conclude the trial court erred in sustaining the demurrer based on the statute of limitations. Plaintiff’s claim for inverse condemnation did not accrue until the City’s occupation of the property became wrongful, which did not occur until the eminent domain proceeding was dismissed. We therefore reverse.
Facts and Proceedings
Since this is an appeal from a dismissal following an order sustaining a demurrer, we summarize and accept as true all material allegations of the complaint. (Hensler v. City of Glendale (1994) 8 Cal.4th 1, 8, fn. 3 [32 Cal.Rptr.2d 244, 876 P.2d 1043]; Shoemaker v. Myers (1990) 52 Cal.3d 1, 7 [276 Cal.Rptr. 303, 801 P.2d 1054].) In this instance, plaintiff’s only challenge is to dismissal of the inverse condemnation claim contained in his second amended complaint. We therefore take the facts from the second amended complaint.
On October 23, 1998, the City filed an action in eminent domain to acquire a portion of a parcel of property located at 4218 Pock Lane in Stockton (the Property) for the purpose of constructing a roadway. The Property is owned by the Trust. At the time, the City deposited $90,200 with the trial court as probable just compensation for the Property. On or about December 31, 1998, the court entered an order granting the City prejudgment possession of the Property. The City thereafter constructed the proposed roadway. On November 6, 2000, plaintiff, as successor trustee of the Trust, withdrew the $90,200 deposit.
On October 9, 2007, the trial court dismissed the eminent domain action for failure to bring the matter to trial within five years (Code Civ. Proc., §§ 583.310, 583.360).
*68On March 14, 2008, plaintiff filed this action against the City alleging a single cause of action for inverse condemnation. The City demurred on the basis of the statute of limitations, asserting that plaintiff’s claim is governed by a five-year limitation period and the claim accrued in 1998, when the City first acquired the Property. The trial court agreed and sustained the demurrer with leave to amend.
Plaintiff filed a first amended complaint, again alleging inverse condemnation. The City again demurred on the basis of the statute of limitations and the trial court sustained the demurrer with leave to amend.
Plaintiff filed a second amended complaint containing a claim for inverse condemnation plus three related claims. The City again demurred. The trial court sustained the demurrer to the inverse condemnation claim without leave to amend. On the other claims, the court sustained the demurrers with leave to amend.
Plaintiff filed a third amended complaint containing four causes of action, but no claim for inverse condemnation. The City again demurred, and the trial court sustained the demurrers without leave to amend. The court thereafter entered judgment of dismissal.
Discussion
I
Klopping v. City of Whittier
In the second amended complaint, plaintiff alleged that when the trial court proposed to dismiss the eminent domain action for failure to prosecute, he supported the dismissal based on representations by the City that it intended to refile the action. Plaintiff contends the second amended complaint adequately stated a claim for inverse condemnation, because the City’s failure to file a second eminent domain action after promising to do so “subjects the City to inverse condemnation liability under Klopping v. City of Whittier (1972) 8 Cal.3d 39 [104 Cal.Rptr. 1, 500 P.2d 1345].”
In Klopping, the city initiated condemnation proceedings but later abandoned the action due to a pending lawsuit filed by one of the defendants. At the time of abandonment, the city announced its intention to reinstitute proceedings once the other lawsuit was resolved. The city later reinstated and completed the condemnation action. The plaintiffs, who were owners of a portion of the target property, filed a complaint in inverse condemnation, claiming the fair market value of their property had declined during the *69period between the city’s announcement of an intention to reinstate the condemnation proceeding and the actual completion of that proceeding. The plaintiffs alleged the condemnation cloud hanging over the property during this period reduced its rental value. (Klopping v. City of Whittier, supra, 8 Cal.3d at pp. 45-46 (Klopping).)
The California Supreme Court concluded the plaintiffs could recover for the reduced rental value of their property under the circumstances presented. The court first cautioned that any reduction in value occasioned by a routine announcement of condemnation proceedings is not recoverable. (Klopping, supra, 8 Cal.3d at p. 51.) “However, when the condemner acts unreasonably in issuing precondemnation statements, either by excessively delaying eminent domain action or by other oppressive conduct, our constitutional concern over property rights requires that the owner be compensated.” (Id. at pp. 51-52.)
Plaintiff contends the circumstances presented here “provide an even more compelling case for damages than the circumstances in KloppingPlaintiff argues that, under Klopping, “the City may be held liable in inverse condemnation arising either (1) from unreasonably delaying filing its promised second eminent domain action after announcing an intent to file, or (2) from its unreasonable conduct prior to filing any action.”
The City responds that Klopping has no bearing on the present matter, because there is no allegation here of unreasonable precondemnation activity. Even if the City promised to refile the eminent domain action, which the City denies, this occurred after the eminent domain action was filed. There was no second filing, as in Klopping. Furthermore, the City argues, plaintiff does not allege damage based on a promise to refile the eminent domain action, but from construction of the roadway across the Property.
We agree Klopping has no bearing on the present matter. Klopping involved a claim that a party’s unreasonable precondemnation actions depressed the value of the target property even before any physical invasion of it. In Klopping, the mere anticipation of a condemnation proceeding depressed the value of the property. In the present matter, plaintiff does not allege the City’s announcement of an intention to condemn or its promise to refile the condemnation action somehow reduced the value of the Property. Plaintiff’s claim is that the actual invasion of the Property by the construction of a roadway across it reduced the value of the Property and is a taking requiring just compensation.
*70II
Statute of Limitations
The trial court concluded plaintiffs inverse condemnation claim is barred by the applicable statute of limitations. In reaching this conclusion, the court determined plaintiffs claim accrued at the time the City took prejudgment possession of the Property on December 31, 1998, and the statutory period expired five years later, on December 31, 2003.
Plaintiff contends the claim did not accrue when the Property was first taken but when that taking became unlawful. Plaintiff argues the City took possession of the Property pursuant to a court order granting such possession, and the City’s continued occupancy of the Property by virtue of the constructed roadway did not become unlawful until the eminent domain action was dismissed without a new one being filed.
We agree. The statute of limitations applies to claims for inverse condemnation. (Otay Water Dist. v. Beckwith (1991) 1 Cal.App.4th 1041, 1048 [3 Cal.Rptr.2d 223] (Otay).) The trial court used the five-year statute of limitations applicable to actions for adverse possession (Code Civ. Proc., § 318). Courts have applied this statute “where a public entity has physically entered and exercised dominion and control over some portion of a plaintiff’s property.” (Bookout v. State of California ex rel. Dept. of Transportation (2010) 186 Cal.App.4th 1478, 1484 [113 Cal.Rptr.3d 356].) On the other hand, plaintiff’s claim is arguably based on damage to the Property by virtue of the construction of a roadway across a portion of it. Such a claim may be governed by the three-year statute of limitations for actions based on trespass upon or injury to real property (Code Civ. Proc., § 338, subd. (b)).
We need not decide which limitation period applies here. The City first took dominion over a portion of the Property in December 1998, when the trial court gave the City prejudgment possession, and plaintiff did not file his ■ inverse condemnation claim until March 2008, more than nine years later. Thus, whether we apply the five-year or the three-year statute of limitations, the question of whether the statute has run turns on whether plaintiff’s cause of action accrued at the time the City took possession of the Property or later, when the City abandoned its eminent domain action.
The City contends plaintiff’s cause of action accrued when the City first took possession of the Property, and the trial court agreed, citing as support Mehl v. People ex rel. Dept. Pub. Wks. (1975) 13 Cal.3d 710 [119 Cal.Rptr. 625, 532 P.2d 489] (Mehl); People ex rel. Dept, of Transportation v. Gardella *71Square (1988) 200 Cal.App.3d 559 [246 Cal.Rptr. 139] (Gardella Square); and Otay, supra, 1 Cal.App.4th 1041. However, as we shall explain, those cases are inapposite.
In Mehl, the state constructed a freeway on property immediately adjacent to and south of the defendants’ property and, to accommodate the natural drainage flow that would otherwise be blocked by the freeway, installed a culvert under the freeway that channeled the runoff onto the defendants’ property. In February 1969, the county condemned a drainage easement down the middle of the defendants’ property. The defendants cross-complained against the state in inverse condemnation for partial loss of their property as a result of the freeway construction. The trial court rejected the state’s statute of limitations defense and awarded damages to the defendants on their cross-complaint. The Court of Appeal affirmed on all issues except the calculation of damages. (Mehl, supra, 13 Cal.3d at pp. 714—715.)
The California Supreme Court agreed the defendants’ claim was not barred by the statute of limitations. The court explained: “The taking asserted in this action consists of the channeling of a flow of extra water onto the Mehl property. [In essence, the Mehls asserted that the state had appropriated a drainage easement over their property.] The date the taking occurred is not necessarily the date on which the period of limitation and of claims started to run. [] [Rather, the period begins to run when the damage is sufficiently appreciable to a reasonable man. [Citation.]]” (Mehl, supra, 13 Cal.3d at p. 717, fit. omitted.) The trial court found the defendants did not become aware of the drainage system until 1969, and the high court concluded this finding was supported by the evidence. (Ibid.)
In Gardella Square, the Department of Transportation filed a condemnation action concerning a parcel of unimproved property, and the property owner asserted an affirmative defense of inverse condemnation based on precondemnation conduct by the department that allegedly interfered with the owner’s attempts to develop the property prior to condemnation. (Gardella Square, supra, 200 Cal.App.3d at pp. 563-564.) In that opinion, which involved issues of prejudgment interest and litigation expenses, not the statute of limitations, the Court of Appeal stated: “[A] cause of action for inverse condemnation arises from a governmental invasion or appropriation of a valuable property right which directly and specifically affects the landowner to his injury.” (Id. at p. 571.)
In Otay, a water district obtained a ranch in 1962 and constructed a reservoir which, inadvertently, also encompassed adjacent property later acquired by the defendant. The water district eventually learned of the error and, in 1989, filed an action to quiet title to a prescriptive easement over the *72property. The defendant and others cross-complained for inverse condemnation. The trial court granted summary judgment to the water district on both its claim for prescriptive easement and the cross-complaint for inverse condemnation, and the Court of Appeal affirmed. (Otay, supra, 1 Cal.App.4th at pp. 1044-1045.)
The appellate court explained the limitations period on inverse condemnation claims normally begins to run when the governmental entity takes possession of the property. (Otay, supra, 1 Cal.App.4th at pp. 1048-1049.) “Where, however, there is no direct physical invasion of the landowner’s property and the fact of taking is not immediately apparent, the limitations period is tolled until ‘the damage is sufficiently appreciable to a reasonable [person] ....’” (Id. at p. 1049.) The defendant argued he was not aware of the encroachment until the water district filed its action in 1989. The appellate court rejected this argument, concluding the encroachment was open and apparent and the defendant was able to determine the nature and extent of the taking long before the water district filed its action. (Ibid.)
None of the foregoing cases addresses the issue presented in this matter. The statement in Gardella Square about when a cause of action in inverse condemnation arises was dictum. The case involved precondemnation activity that reduced the value of the property, not whether an inverse condemnation claim arises from an invasion that is initially authorized by court order.
In Mehl and Otay, the question was whether the inverse condemnation action had been brought within the statutory period after the taking should reasonably have been discovered by the property owner. In Mehl, the high court concluded substantial evidence supported the trial court’s determination that the defendants were unaware of the drainage diversion across their property until the county filed its eminent domain action. In Otay, the Court of Appeal concluded the reservoir was obvious to the defendant long before the quiet title action was filed. In both cases, the encroachment had been wrongful at its inception.
In the present matter, there is no question plaintiff’s predecessor was aware on December 31, 1998, that the City had taken possession of the Property. However, at the time, the City’s possession was pursuant to a court order. In other words, the City was not in wrongful possession of the Property. The question presented here is thus whether, under such circumstances, the statute of limitations begins to run at the time of permissive possession on any inverse condemnation claim that might later arise from that possession.
“ ‘Generally, a cause of action accrues and the statute of limitation begins to run when a suit may be maintained. [Citations.] “Ordinarily this is *73when the wrongful act is done and the obligation or the liability arises, but it does not ‘accrue until the party owning it is entitled to begin and prosecute an action thereon.’ ” [Citation.] In other words, “[a] cause of action accrues ‘upon the occurrence of the last element essential to the cause of action.’ ” [Citations.]’ [Citation.]” (Howard Jarvis Taxpayers Assn. v. City of La Habra (2001) 25 Cal.4th 809, 815 [107 Cal.Rptr.2d 369, 23 P.3d 601].)
A trespass requires that the entry be without permission. (See CACI No. 2000.) In the present matter, plaintiff could not have maintained an action in trespass against the City while the eminent domain action was pending, because the City’s occupancy was authorized by court order. Hence, the three-year statute of limitations applicable to trespass actions did not begin to run until the City’s occupancy was no longer pursuant to permission of the court, which did not occur until the eminent domain action was dismissed.
Nor could plaintiff have maintained an action against the City to recover real property, within the meaning of the five-year statute of limitations (Code Civ. Proc., § 318). The City did not possess the Property under a claim of right, as required for adverse possession or a prescriptive easement. (See Felgenhauer v. Soni (2004) 121 Cal.App.4th 445, 449 [17 Cal.Rptr.3d 135].) Rather, the City was attempting through the eminent domain action to establish its claim of right to occupy the Property. The City had been given a temporary right of occupancy only. It was only after that temporary right expired, with dismissal of the eminent domain action, that the applicable statute of limitations began to run.
Taken to its logical conclusion, the trial court’s ruling would mean that every time a condemning authority takes prejudgment possession of the subject property, the owner would have to file a protective inverse condemnation claim in the event the eminent domain action is later dismissed. Such action would then remain dormant while the eminent domain action ran its course.
Under the circumstances presented, a cause of action for inverse condemnation did not accrue until the City no longer had a right to occupy plaintiff’s property. This did not occur until the eminent domain action was dismissed. Only then did the statute of limitations begin to run. Because plaintiff filed the instant action less than a year after the trial court dismissed the eminent domain action, the action was timely, and the trial court erred in sustaining demurrers to the inverse condemnation action of the second amended complaint.
Disposition
The judgment is reversed and the matter is remanded to the trial court with directions to vacate its order sustaining and enter a new order overruling the *74City’s demurrer to the first cause of action (inverse condemnation) of the second amended complaint. Plaintiff shall receive his costs on appeal.
Raye, P. J. and Nicholson, J., concurred.