delivered the opinion of the court:
After this case was argued in this court, an act entitled, “An Act in Relation to Courts of Review,” chapter 107, Session Laws of 1911, became effective, and the court of appeals was established thereunder. The cause was thereupon transferred to that court by the terms of the act. It, however, was re-transferred here, as involv*283ing constitutional questions, and we will, therefore, proceed to determine the matters presented.
The applicant was adjudged to pay a fine for the violation of the provisions d'f section 2 of an ordinance of the City of Fort Collins. The cause was first tried in the police magistrate’s court of that city, and appealed to the county court. Thereafter, a trial de novo was had in the latter court, resulting in a like judgment, from which this appeal is prosecuted.
The argument for reversal of the judgment is based upon the alleged invalidity of the section of the ordinance under which the forfeiture was imposed, which reads as follows:
“Section 2. It shall be unlawful for any person, persons or corporation owning or operating a railroad of in any way engaged in the.running or handling of railroad trains, locomotives or cars, to use any railroad track upon any railroad street crossing south of the north line of West Mountain ‘avenue in said city, for the purpose of switching or shifting cars, or the making up or breaking up of trains.”
February 9, 1865, the territorial legislature of Colorado passed an act incorporating “The Colorado & Clear Creek Railroad Company,” authorizing it to survey, locate, construct, complete, alter, maintain, and operate a railroad, with one or more tracks, through certain portions of the state, and granting to such railroads, for the purposes named, the “lands, materials and privileges belonging to the territory.” The act further authorized the railroad corporation to “construct such road on or across other railroads, common roads, rivers or streams which it may intersect, in such a manner as not to materially impair their usefulness.”
*284In June, 1877, the appellee, by ordinance, granted the right of way to “The Colorado Central Railroad,Company to build, construct and operate in and through the town of Fort Collins, a track or tracks for railroad tpurposes, as follows: Commencing at the south line of said town where a prolongation of Mason street across Laurel street intersects the same, thence north along said Mason street, and through over and across Laurel, Myrtle, Mulberry, Magnolia, Olive and Oak streets, Mountain ayenue, La Porte avenue, Maple street and .Cherry, street, Sycamore street, Elm street and. Vine street, to the north line of. said'town at any'and.all points where said streets and avenues intersect or cross said Mason street, with.the privilege of laying one or more tracks along said right of way. Also the right of way through,'over and along-the following named streets and avenues in said town of .Fort Collins, to-wit: La Porte avenue, Maple street and Cherry street, at any and all points between Meldrum street and College avenue, with the privilege of laying one or more switches or side tracks through, over, across and along said streets and avenues. Also the right of way over and across Meldrum and Sherwood streets between Maple and Cherry streets. To have and to hold the same to the said Colorado and Central Railroad Company, its successors and assigns forever.”
The franchises, rights and property of “The Colorado & Clear Creek Railroad Company,” and of “The Colorado Central Railroad Company” were assigned to, and became the franchise, rights and property of the appellant. The railroad now owned and operated by appellant through the city of Fort Collins, was built under and by virtue of the legislative act and the ordinance aforesaid. - ■ •
*285<• Appellant contends, that the section of the- ordinance- -in' question is invalid, because it impairs' the -contract- rights acquired by it under the act of' the territorial legislature,' and the ordinance aforesaid, and is so unreasonable- as to render it void; that appellee, by long acquiescence and by affirmative acts, recognized the right of appellant to use its railroad track upon the .street crossings in question “for the purposes of switching or shifting cars, or the making up or breaking up of trains,” and is now-estopped from denying the right.
The contention of appellant, that where rights, privileges and immunities are lawfully granted to, and-'accepted by another, and money or its equivalent is • expended on'the faith óf such grant, a binding contract is thereby created, which the courts will compel the parties to respect and observe according to the terms of the grant, is conceded. It is, however, equally certain that “the governmental power of self-protection can not be contracted away, nor can the exercise of rights granted, nor the use of property be withdrawn from the implied liability to governmental regulation in particulars essential to the preservation of the community from injury.” The right given to a railroad company to lay down and use tracks in, along or across a street or public highway is not exclusive, but is subject to the limitation that the use of the street by the general public shall not be unnecessarily or materially injured; and the rights of each therein must be exercised with due regard to the rights of the other.—■ 33 Cyc. p. 206, C.; State v. Morris & Essex R. R. Co., 25 N. J. L. 437; Mills on Eminent Domain, section 200.
The law in this respect is stated in Wabash R. R. Co. v. Defiance, 167 U. S. 88, 100, as follows:
“While municipalities, when authorized so to do, doubtless have the power to make certain contracts with *286respect to the use of their streets, which are obligatory upon them, * * * the gexieral rule to be extracted from the authorities is that the legislatuve power vested in municipal bodies is something which cannot be bartered away in such manner as to disable them from,the perfoi-mance of their public functions. These bodies ex-r ercise only such powers as are delegated to them by the sovereign legislative body of the state. Such powers, however, are personal to the xnunicipalities themselves, and, being conferred for the bexiefit of the whole people,in the absence of authority to that effect, cannot be bestowed by contract or otherwise upon individuals or coi'porations in such manner as to be beyond revocation.”
Streets and highways are established and maintained primarily for the purposes of travel and transportation, and when a railroad company is authorized to lay its tracks thereon a presumption arises that the use thereixnder must.be for similar purposes. Whether the right to the use of a street through a municipality could be granted a railroad company by the legislature, to the exclusion of a reasonable use of such street, and the control thereof by the municipality, need not be determined herein. An inspection of the charter provision renders it clear that no such right was conferred or attempted to be conferred thereby.—St. Louis R. R. Co. v. Trustees, etc., 43 Ill. 303.
The authority granted by the legislative charter to the corporation, or its assignors, to construct its railroad on or across “common x'oads,” etc., does not include the right to the use of the streets of the sevex'al xnunicipalities within the state through which the road may pass-. C. D. & V. R. R. Co. v. City of Chicago, 121 Ill. 176, 185, 186. Therefore, whatever rights were granted to the railroad company or its assignors, to constx-uct a line of road along *287or across the public streets of the appellee must be measured and determined by the ordinance of June 7, 1877. Directing our attention to that instrument, it is evident therefrom that the right granted was to build, construct and operate in and through the town of Fort Collins, a track or tracks for railroad purposes. That right, however, was segregated into two parts. First, the right to enter the town at the south line thereof at a designated point, and to pass along Mason street and through, over and across other designated streets and avenues where the latter streets and avenues intersect or cross Mason street, with the privilege of laying one or more tracks along said right of way: second, the right to 'construct its road over and along certain other designated streets at any and all points between Meldrum street and College avenue, “with the privilege of laying one or more switches or side tracks along said streets and avenues.” The right granted is for’ railroad purposes as therein designated, that is, pne right is for the purpose of getting locomotives and cars in and out of the city; the other for the same, and the additional purpose of switching and shifting cars or making up trains.—Fitzgerald v. Balt. & Pot. R. R. Co., 19 D. C. R. 513; P. R. R. Co. v. Angel et al., 41 N. J. E. 316.
As said in Hopkins v. Baltimore & Potomac R. R. Co., 6 Mackey Rep. 311, 314:
“We hold the only use that can lawfully be made of Maryland avenue, (a street over which the company had been granted the right to construct and operate its road), by the company in. shifting and making up its trains must be confined to such use as may be reasonably necessary for the purpose of carefully taking its cars into, or of carefully taking its cars out of, the station, to place them in freight trains on the track. To authorize *288the occupation of the avenue as a general shifting ground would be to subject it to- a use that could not have been contemplated by the legislature when it authorized this company “to extend its lateral branch/ by way of Maryland avenue to the Fong Bridge. * * *
“A railroad company may and should possess itself of proper accommodations on its own property, where this dangerous process of shifting and making up trains may be conducted in safety, without continual risk and inconvenience to the public. Citizens have the right at all times to cross .and travel the streets and send their children and servants along them on lawful errands without peril. or delays, and to enjoy some intervals of quiet from the noises of movements that should be conducted within proper inclosures of this company, in more secluded portions of the city.”
The same principle is declared in Owensborough & N. R. Co. v. Sutton, 13 S. W. 1086, where it is said:'
“There is no reason nor necessity in this, or any other case like it, for a railroad company to use a public street as a place for making up its trains, or as a depot for standing cars, or for receiving or discharging freight; for such use necessarily defeats the purpose for which streets are dedicated to the public.”
In Atl. & Bir. Ry. Co. v. Mayor, etc., 122 Ga. 1, 2, 3, 4, an ordinance of the town of Montezuma was under consideration, which prohibited engines going through Cherry street at a greater rate than three miles an hour, requiring a flagman to go ahead of the train, and declared, that “No train or engine will be permitted to stop, drill, or in any manner shift or transfer cars between the east side of Spaulding street and the Rosser warehouse, except to prevent accident, under penalty of being punished'as provided in section 13 of the charter.” The city *289council caused the ordinance to be enforced by arresting and prosecuting engineers guilty of “switching, drilling, shifting and transferring cars between the points designated.” The railroad company sought to have the ordinance, and particularly that portion thereof hereinbefore quoted, held invalid on the ground that it impaired rights vested in it. In upholding the ordinance Mr. Justice Lamar, now a member of the supreme court of the United States, said:
“Streets and highways are intended primarily for the purposes of travel and transportation. When a railroad company is authorized to lay its track thereon, there is a conclusive presumption that the use thereunder must be for similar purposes. A private citizen would not be authorized, even in front of his own premises, to obstruct a street, or to use it as a place of storage, or for any purpose which would interfere with the rights of the balance of the public. The railroad company stands upon the same footing. While permitted to use the street or the highway for transportation, it must adjust itself to the rights of the public in the same way that the public must adjust itself to the rights of the company. The railroad company can not unreasonably obstruct the street, or interfere with travel. It can not use the street as a depot, or a place for loading or unloading cars. And it has been repeatedly held that a railroad company can not use the street as a yard, or for switching or drilling purposes.”
The ordinance in question in no wise attempts to prohibit the moving of cars across the streets upon which the railroad company was granted the right to construct and operate its road. It requires, in effect, that the railroad company, in making up its trains, shall be confined to its yards properly set apart for that purpose. The language *290of the ordinance makes it unlawful to use any railroad track upon any railroad street crossing south of the north line of West Mountain avenue “for the purpose of switching or shifting cars, or the making up or breaking up of trains.” It in no wise inhibits the railroad company to carry a car or cars “from one side of the street to the other, across the street, for the purpose of being made a part of the train' being made up at some place in the yards,” but the effect of its inhibition is, “that the company shall not stop its engines, cars or trains, on or across the street, in the operation of making up a train,” and, therefore, comes clearly within the rule approved in Mayor and Aldermen of Birmingham v. Ala. G. S. R. R. Co., 98 Ala. 134, 142, relied upon by appellant As the express grant upon and across the streets of facilities for switching cars is confined to certain streets situate entirely north of West Mountain avenue, and the ordinance in question is confined to those streets south thereof, it would seem that the prime purpose and object of the ordinance is to make certain that there shall be a proper observance by the railroad company of the rights granted, and respect for those reserved.
Appellant endeavors to distinguish the ordinance here from the one upheld by Mr. Justice Lamar in Atl. & Bir. Ry. Co. v. Mayor, etc., supra, by pointing out that in the latter ordinance the acts prohibited were permitted when necessary “to prevent accident.” We do not think the exception rendered the ordinance less vicious than it would have been without it. That which is necessarily implied is as much a part of a law as that which is expressed therein. An act necessarily done to prevent an accident, though within the letter of an inhibition of the law, can never be within its spirit, and is, therefore, excused. For example, if the law prohibited the discharge *291of fire arms within the city limits, surely it would not be a violation thereof to discharge fire arms, within such limits, in necessary self-protection of person and property.
The appellant seeks to maintain its alleged rights under the doctrine of equitable estoppel as applied to the municipality. Counsel assert that “appellee, from time to time, by affiirmative action has permitted, if not encouraged, the appellant to make changes, at least one of which would result in appellant doing more switching south of the limit” fixed by the ordinance. The one particular change was the right to locate a passenger depot on Fa Porte avenue, about four hundred feet north of Mountain avenue, and the placing of a switch between the two avenues connecting the depot track with the main line. It appears that the depot track extends north and into the company’s yards. These facts do not bring the case •within the doctrine of equitable estoppel. The record does • not disclose an affirmative act on the part of the municipality that could in any wise mislead the appellant, or give rise to a presumption of abandonment, and it is only under such circumstances that the doctrine is applied.
While the appellee carried on some of the things prohibited, for a considerable period of time before the enactment of the ordinance, we think the record shows that it was only to a very limited extent. The record shows that the evil against which the ordinance is directed was of recent growth, and brought about by the great increase in the number of trains operated by appellant, made necessary by the rapid development of the country. But as said in Glick v. R. R. Co., 10 Mackey, 363, 366:
“If the mere expansion of the company’s business were sufficient to justify it in doing everything that might facilitate its management, then there would be no end to its encroachments on public and private interests. It *292could spread out from the station, as a center, to- all points of the compass, occupying the streets in all directions for loading and unloading, parking and shifting cars, and making up or undoing trains, to the utter detriment of all the private property in the neighborhood.” .
The record shows that immediately prior to the passage of the ordinance, the manner of operating appellant’s road materially affected the usefulness of certain streets for the purposes for which they were intended.- We are of the opinion, therefore, that the regulation'and control of such streets, as contemplated by the ordinance, is just and right, and within the power of the municipality. The judgment should be affirmed, and it is so ordered.
Judgment affirmed.
Decision en banc.
Chief Justice C'ampbEee not participating.