This is a suit in equity instituted against the city of San Francisco and a large number of private parties, for the purpose of obtaining a decree ordering, adjudging, and declaring,— 1. That-the plaintiff is the successor in interest of one Peter T. Scherrebeck, and, as such, the equitable owner of a tract of land eight hundred varas square, situated in the heart of the city; 2. That the United States, in conveying the premises to the city and county of San Francisco, did so in trust for the plaintiff, thereby imposing upon said city and county the duty of conveying the same to him; 3. That said city and county, as successor of the Mexican pueblo of Yerba Buena, is, with respect to said premises, bound by the acts of the various officials of the former government prior to the conquest, and by the acts and declarations of the United States and its military and other officers pending and since the conquest; 4. That said city and county, and the numerous private parties who are alleged to be in possession of the premises, and for that reason united as defendants in the suit, be adjudged to hold and to have held such possession with full notice of the equities of the plaintiff, his grantors and predecessors, and directed to convey their interest and surrender the same to him; that if they refuse so to do, commissioners be appointed fo execute such conveyances, and also to take an account of the rents and profits of the premises, and that defendants be charged therewúth.
Some other specific relief is asked, and there is a prayer for general relief, but the foregoing epitome of *445the prayer of the complaint is sufficient to indicate the nature of the action.
The defendants demurred to the complaint upon numerous grounds, and their demurrers were sustained, whereupon final judgment was rendered in their favor. From this judgment the plaintiff appeals, and the question to be determined is, whether the complaint is insufficient in any of the particulars stated in the demurrers.
For the purpose of this inquiry, it is necessary to state at least the substance of the complaint, which, it is to be observed, is extremely prolix and redundant, especially in its allegations of matters of law, as to which it is not always strictly accurate. It is alleged that the state of California was, prior to July 18, 1848, a political department of the republic of Mexico, and was subdivided into pueblos constituting political municipalities, supplied with such officials as the republic or governor of the department chose to appoint; that such officers could grant and distribute lands of the municipalities; that the pueblo of Yerba Buena, or San Francisco, was one of such municipalities, and was provided with a prefect appointed by the republic and the governor of California, and empowered, among other things, to make grant and distribution of land to private persons in fee, within his district and said municipality; that there was also an alcalde of said pueblo, who had power to represent the community and express its will as to the propriety of granting lands within the pueblo, and whose acts were binding, unless reversed on appeal to the governor; that at all times mentioned in the complaint, prior to the conquest, Manuel Castro was prefect and José De la Sanchez was alcalde of said pueblo; that prior to the grant hereinafter mentioned, the land therein described was vacant and within the boundary and jurisdiction of said pueblo, and subject to grant by said prefect; that Peter T. Schorrebeclc, a resident and naturalized Mexican citizen, presented to said prefect the following petition: —
*446“ Señor Prefect of the Second District.
“ I, Peter Scherrebeck, a native of Denmark, a citizeri of Mexico, and a resident of this place, appear before your honor, and respectfully represent that, desiring to devote myself to agricultural pursuits, and also to establish a dairy, for which purpose I am in need of a suitable piece of land, I pray your honor, in the exercise of your powers, to be pleased to grant me the place called Rincon, which is situated one fourth of a league southerly from this place, containing one half league, bounded by the beach and the wood, as explained in the accompanying sketch. Wherefore, I beseech you to accede to my petition, whereby I should receive favor, etc.
“Yerba Buena, November 24, 1845.
[Signed] “ Peter Scherrebeck.”
Thereupon, said prefect, on receipt thereof, indorsed thereon as follows: —
“Yerba Buena, November 25, 1845.
“The chief local authority of this place will report whatever he may deem convenient upon the contents of this petition.
[Signed] “ Castro.”
And delivered the same to the said pueblo; and said pueblo of Yerba Buena, by its officer aforesaid, J. De la Sanchez, in its behalf, and as by law authorized, reported to the said prefect the following, to wit:—
“ Señor Prefect of the Second District.
“In obedience to the supreme decree of your honor, I should report that the land which the party in this representation solicits is vacant; that the petitioner possesses the requisite qualifications to be heard,—notwithstanding this juzgada is of the opinion that only land upon which to build a house and corral, and to plant, can be granted to him, upon which questions your honor will determine whatever you maj»- deem most proper.
“ Yerba Buena, November 2.6, 1845.
[Signed] “ J. De la C. Sanchez.”
Which report, with the petition, was made and returned *447to the said prefect, who thereupon, by and with consent and approval of the pueblo of Yerba Buena, and the governor of the territory of California, and approval of the republic of Mexico, granted and confirmed to the said applicant the lands petitioned for, — a tract of eight hundred varas square,—the line bounding the same to correspond with the points of the compass bearing north and south and east and west, as adopted in official surveys, the central and initial central point being an oak-tree, which stood at the point now known and designated on the official map of the city and county of San Francisco as the southwest corner of Third and Harrison streets, the grant so made being in words and figures following:—
“In view of the present petition, the report of the municipal authority of Yerba Buena, and other proceedings had by virtue of the power invested in me by the law of the 20th of March, 1837, I grant to Don Pedro Scherrebeck the ownership of the place called Yerba Buena, to the extent of eight hundred varas square, he being subject to pay the tax that may be assessed to him by the most excellent departmental assembly. Let this expediente be returned to the party interested, serving him as a title, that he may take possession of said land. The undersigned prefect thus decreed, ordered, and signed in the pueblo of San José, this fifth day of December, 1845.
[Signed] “ Man’l Castro.”
Which said grant was at date of issuance duly recorded by the prefect in the archives and registers of said prefecture, as provided by law, and as was the custom in such cases; that the said prefect, on the fifth day of December, 1845, at the said Yerba Buena, delivered the expediente of the grant last described and named to the said Pedro T. Scherrebeck, who is the same person elsewhere called in this complaint Peter T." Scherrebeck, who thereupon, with the knowledge, consent, and approval of the authorities of said Yerba Buena, and espe*448cially that of the said José De la C. Sanchez, without objections from any whomsoever, was placed in possession of the said eight hundred varas square, with its metes and bounds established, the same being the property granted to him as aforesaid by said José De la C. Sanchez, who was by the law invested with the power of placing parties in legal possession of property granted to them in said Yerba Buena, and said Peter T. Scherrebeck thereupon entered into the occupancy and possession of the said eight hundred varas square, granted as aforesaid, arid described in the expediente heretofore set forth, it being the same eight hundred varas before described, located by measuring from an initial point now described as the southwest corner of Third and Harrison streets according to the present official map of the city and county of San Francisco, and running four lines with the points of the compass, as officially recognized by surveyors, four hundred varas distant therefrom in each direction, and measuring the same by parallels drawn from the terminal points of the said four lines, so as to include eight hundred varas square, with said initial point in the center thereof.
It is further alleged that said Scherrebeck inclosed, improved, and occupied said premises, his occupation and ownership being recognized and respected by the government, the pueblo, and all other persons until the cession of the territory by the treaty of peace between Mexico and the United States.
The complaint then alleges the war, the conquest, the treaty and cession, the military proclamations pending the conquest, the terms and effect of the treaty, the admission of California as a state, the obligations she assumed, etc. Next are alleged the several and successive acts of the legislature, incorporating the city of San Francisco in 1850 and 1851, and consolidating the city and county in 1856, and it is alleged that within the boundaries established by each of these acts was included said eight hundred varas so granted to Scherrebeck, and a part or all of the former pueblo. Next is *449alleged the act of Congress of March 3, 1851, to expedite the settlement of private land claims in California, with the pleader’s construction of it. It is next alleged that said city, in July, 1852, as trustee of said Scherrebeck, under said last-mentioned act, presented to the commissioners thereby created its claim for four square leagues of land, including said eight hundred varas, prosecuted the same to final decree of confirmation, and obtained a patent for said four leagues in June, 1883, which it took as trustee for plaintiff to the extent of said eight hundred varas. It is next alleged that, pending said proceedings for confirmation, “the said city and county of San Francisco disputed with the said grantee touching the exact location of the said eight hundred varas square, and the fact of the grant aforesaid, when and whereupon the said grantee presented his petition to said board of land commissioners in his own behalf, praying confirmation and location thereof, etc.; that his claim was finally confirmed and exactly located by decree of the district court in December, 1859. It is next alleged that, pending said confirmation, the city and county of San Francisco assumed the management, control, and occupancy of said land by itself, and those holding under it, and does yet control, hold, and enjoy the same, together with the rents, issues, and profits thereof, by itself and the other defendants; that the reasonable value of said use and occupancy is one million five hundred thousand dollars to August 1, 1885, and two hundred and fifty thousand dollars per month since that time; that plaintiff is successor to Scherrebeck; and that the defendants, and each of them, and their predecessors have at all times had full knowledge of the relation of trust and confidence existing between the city and county of San Francisco and the plaintiff and his predecessors. Therefore plaintiff prays, etc.
In considering the objections to this complaint, we remark at the outset that its allegations are accepted as true so far only as they relate to matters of fact as distinguished from matters of law. As to the latter, they *450will be treated as if they were not made, because, so far as they are correct, they are useless, and when erroneous, worse than useless. This remark applies not only to the allegations respecting the laws enacted and in force since the conquest and cession of California, but also to the laws of Spain and Mexico which were in force prior thereto. As to the former, we do not understand counsel for appellant as contending for a different rule; but as to the laws of Spain and Mexico relating to the powers and duties of prefects and other officials respecting the granting of lands, etc., he seems to contend that for the purposes of this appeal, the allegations of the complaint must be taken as true. If such is his contention, we cannot accede to it. We understand that our legal tribunals, in adjudicating upon rights originating under and depending upon the laws of Spain and Mexico in force in California prior to the conquest, take judicial notice of such laws in the same manner and to the same extent that they take notice of the common law of England as a part of our own municipal law. The municipal laws of a conquered territory do not cease to exist by reason of the conquest and change of sovereignty, but continue in force, so far as they are not repugnant to the paramount laws of the new sovereign, until changed by the legislature. This results from the absolute necessity of preserving the rules by which private rights are governed. Such laws, therefore, become and remain, until repealed or altered, the municipal law of the new sovereignty, which its courts are bound to notice and to enforce. Upon the same principle and with the same necessity it results that, so far as private and vested rights of the inhabitants of the conquered territory are dependent upon the exercise of official power by the functionaries of the former government, the rules defining such power must be noticed in the same way. For such purposes they are not to be treated as foreign laws, and alleged and proven as facts. (Fremont v. United States, 17 How. 537.) Looking, then, to the complaint for facts, and to other proper sources for *451the law, we proceed to consider the principal points made in support of the demurrer.
1. • It is contended by the respondent that the grant of Scherrebeck, under which the plaintiff claims, is void, and that it conferred no rights upon the grantee, and gives none to the plaintiff as his successor.
We do not think this proposition can be sustained in its full extent. The facts alleged as to the making of the grant, the possession under it, the presentation of the claim to the land commission, and its final confirmation by the district court, show a grant which is valid, at least against the United States and all persons claiming thereunder, although not conclusive against the third persons mentioned in the act of Congress of March 3, 1851. And with respect to this grant, we think the city of San Francisco, as successor to the pueblo, and those claiming under the city are such third persons. In other words, we think it clearly appears from the complaint that the grant to Scherrebeck was not made by the prefect as an officer of the pueblo empowered to transmit its title, but that it was made by such prefect by authority from and approval of the governor of the department by virtue of his superior power to grant vacant lands within the boundaries of the pueblos, irrespective of their claim to hold and to dispose of them. We think it was and continued to be a grant held under a title adverse to that of the pueblo.
We cannot find in any of the laws or ordinances of Spain and Mexico to which we have been referred any authority conferred upon prefects to make grants in fee of the pueblo lands. It is not contained in the decree of the Spanish Cortes of January 4,1813, nor in the plan of Pitic, nor in the Mexican law of colonization of 1824, nor in the regulations of 1828, nor, we think, in the law of March 20, 1837, to which the prefect himself refers as the source of his authority. The clause of this act, cited and relied on by appellant, is given in the original Spanish and in translation, at page 314, addenda, Dwinelle’s Colonial History of San Francisco. In terms, it merely *452authorizes the prefects in their respective districts to “ regulate executively ” the distribution of the common lands of the pueblos, provided there are no lawsuits pending in the courts concerning them, saving a right of appeal to the governor. The law-writers do not agree in their construction of this article. Dwinelle thinks it conferred authority to make grants of the pueblo lands for the pueblo. Halleck thinks that it merely conferred a power to regulate the temporary use of the common lands. This court has decided that it did not expressly confer power to grant lands in private ownership. (Hart v. Burnett, 15 Cal. 572.) As a matter of history, it is known that the prefects very rarely attempted to exercise such power, not more than two or three instances, including this grant to Scherrebeck, appearing in the records of San Francisco, and one of those subsequent to the conquest, by Horace Hawes. It is also well known as a fact and as matter of law that the claim of such power by the prefects has been repudiated by the city from the beginning. The complaint here shows that the validity of this Scherrebeck grant was denied by the city as early as 1853, and ever since. The Van Hess ordinance, passed in 1855, and ratified by the legislature in 1858, practically confirmed all previous grants of pueblo lands made by “ any ayuntamiento, town council, alcalde, or justice of the peace of the former pueblo or of the city, but was entirely silent as to grants by prefects. Even the allegations of the complaint do not show that the prefect had power as agent and acting in behalf of the pueblo to alienate its lands in fee. He is said to have authority to make grant and distribution of lands within the pueblo limits, but this power may have been derived from the departmental authorities and exercised independently and against the will of the municipal authorities. And this appears to have been the case with the Scherrebeck claim; the making of the grant was opposed by the alcalde, the only municipal officer who appears to have had anything to do with it, but it was approved by the governor and the superior authorities.
*453The strongest proof, however, of the real character of this grant is found in the circumstances of its presentation to the land commission, and its confirmation by the district court.
The city of San Francisco, as successor to the pueblo, had already, in conformity with its right and duty under the act of Congress of March 3,1851, presented its claim to four leagues of land for confirmation by the land commission. Meantime it was denying and repudiating the Scherrebeck claim. In consequence of this dispute, the Scherrebeck claim was presented by the grantee, and pending the confirmation of the city’s claim, that of Scherrebeck was, in 1859, confirmed by the district court on appeal from the commission. This shows that it was regarded and treated as a claim of a third party, adverse and hostile to that of the city. For the land commission had no jurisdiction, pending the confirmation of the claim of a city or town to lands of a former pueblo, to adjudicate a controversy between the city and the claimant of a grant from the pueblo, as to the validity of such grant. Its 'function was to determine what claims were good against the United States under the treaty of cession; it had nothing to do, except incidentally, with subordinate controversies between the holders of such claims and those claiming under them. Possibly, if a city as successor to the right of a pueblo had neglected to present its claim for confirmation, it might have been allowable for one or more holders of pueblo titles, in behalf of themselves and others, to petition for a confirmation of the pueblo claim. But when the city was itself proceeding with its application for confirmation of its claim to the entire four leagues of pueblo lands, we cannot see how, under the law, the holder of a pueblo grant of a smaller parcel could be allowed to proceed in his own behalf, and still less, how he could procure from the land commission or the district court a conclusive adjudication that his grant from the pueblo was valid. We do know, on the contrary, as a part of the judicial history of the state, that such individual claims to *454pueblo lands were frequently presented for confirmation, but were always held to be claims adverse to the city, and confirmed as such. When so confirmed, the question of superior right was left to be determined in the ordinary tribunals, where its determination properly belongs.
Of many instances of such claims to tracts of lands situated within pueblo boundaries, and held under grants from the governor and .departmental authorities, we cite those litigated in Leese v. Clark, 18 Cal. 535; Lynch v. De Bernal, 9 Wall. 315; Steinbach v. Moore, 30 Cal. 505. Our conclusion, from all the facts alleged in the complaint, is, that this claim of Scherrebeck, as confirmed by the district court, stands in the same relation to the city’s claim as successor to the pueblo as did the claims above referred to. It is and always has been a claim adverse and hostile to that of the city, and the city’s claim is adverse and hostile to it. There is no relation of trust between the city and its grantees on the one side, and the plaintiff on the other. The city never has held any legal title in trust for the plaintiff, and there is nothing to support this suit in equity, or to justify the granting of any of the specific relief asked.
The whole case amounts simply to this: that the city and its grantees are holding the land in controversy under one title, and the plaintiff is claiming it under an independent and adverse title. His remedy, therefore, is by an action at law for the recovery of the land, and not by a suit in equity to compel the transfer of a title under which he can claim nothing. The demurrer was therefore properly sustained on this ground.
2. Even if it were conceded, as appellant seems to claim, that all the allegations of his complaint upon which is founded the prayer for equitable relief can be treated as' surplusage, and the action regarded as one at law for the recovery of the land with its rents and profits, it,would still follow that the demurrer was rightly sustained, on the ground that such an action had been barred by sections 318 and 319 of the Code of Civil Procedure long before this action was commenced.
*455The character of plaintiff’s claim or title has not changed since 1859. Such as it was then it still continues,— an inchoate title unperfected by survey and patent. The city and those claiming in privity with it have been in adverse possession of the demanded premises ever since a date prior to 1859, and this action was not commenced until 1885. Five years of adverse possession at any time since the passage of the act of April 18, 1863 (Stats. 1863, p. 325), bars an action by the holder of an imperfect (unpatented) title of Spanish or Mexican origin. (San José v. Trimble, 41 Cal. 536; Gardiner v. Miller, 47 Cal. 576; Montgomery v. Bevans, 1 Saw. 653; Henshaw v. Bissell, 18 Wall. 269.)
3. These reasons are sufficient to compel an affirmance of the judgment. But the same result would follow if it were allowed that under a proper construction of the complaint the Scherrebeck grant was made by an agent of the pueblo, and conveyed the pueblo title; for if so, the moment the city’s claim to the pueblo lands was confirmed, the title either inured to the plaintiff ipso facto, or his right to compel a conveyance from his trustee accrued. If the theory of the complaint is correct, that the final confirmation of the pueblo title, and the grant from the United States in pursuance of such confirmation, invested the city of San Francisco with the legal title' in trust for plaintiff as to the Scherrebeck claim, and if it is true, as alleged, that the city had denied the validity of the grant years before, then certainly the right to sue for a conveyance — the right, in other words, to maintain this action — at once accrued, and the statute of limitations began then to run against it. But the pueblo title was confirmed and the lands granted to the city by the act of Congress of March 8, 1866. (14 U. S. Stats. at Large, 4.) The previous grant contained in section 5 of the act of July 1,1864 (13 U. S. Stats. at Large, 332), was not in terms a confirmation of the pueblo title, but merely relinquished to the city the title of the United States to the lands within the corporate limits as established by the act of 1851, and the *456conveyance was expressly made for the uses and purposes specified in the Van Ness ordinance, which, as we have seen, did not recognize grants by prefects. • It is probable that the plaintiff could not have maintained this action on his own theory of his relations to the city under the act of 1864, but under the act of 1866 he certainly could have done so, unless he admits that by the terms of that act he was excluded from the benefit of the confirmation; and if he makes this admission he gives up his entire case, for what that statute took away no subsequent patent issued by the executive department of the government could possibly restore. His right, then, to commence and maintain this action, if it has ever existed, accrued in 1866; and however it may be classed, whether as an action to recover land, or otherwise, it was barred long prior to 1885.
And so, also, if we assume that the grant to the city inured to plaintiff’s benefit, passing the legal title to him without the necessity of any further .conveyance from the city (as we think it would have done if his grant had been from the pueblo), his right to maintain an action at law against those in possession then immediately accrued. The legislative grant was for every purpose as effectual as the patent, so far as the transfer of the title is concerned. All that the patent added was a convenient method of proving the exact boundaries. By the grant the title was perfected, and the statute of 1863 then began to run. It is true that the act makes the issuance of a patent final confirmation of a Mexican grant, but the act does not, by its terms, postpone the running of the statute until final confirmation. On the contrary, it declares that the time shall run irrespective of final confirmation, and it is only by a construction imposed upon the statute by the courts that five years is allowed for suit on a Spanish or Mexican title after it has been perfected. The usual mode of perfecting siich titles is, of course, that which is mentioned in the statute, i. e., survey and patent; but when title is perfected by act of Congress, the same construction of the act *457which sets it in motion upon issuance of the patent would set it in motion upon the passage of the act, the reason therefor being in each case the same, viz., that the perfection of the title by grant from the United States, in any form, confers a new right of entry and a new cause of action.
That legislative grants have all the effect of a patent, see the following cases: Montgomery v. Bevans, 1 Saw. 653; Harris v. McGovern, 2 Saw. 515; Palmer v. Low, 98 U. S. 16, 17, and cases there cited; Tripp v. Spring, 5 Saw. 210. Many other decisions might be cited to the same effect, but we do not deem it necessary.
There are other objections to the complaint, but they need not be discussed.
For the reasons above given, the judgment of the su- • perior court is affirmed.
McFarland, J., Sharpstein, J., De Haven, J., and Paterson, J., concurred.
Mr. Justice Harrison, being disqualified, did not participate in the foregoing opinion.