The liability of municipal corporations to compensate persons for injuries sustained by reason of a want of repair of a way is wholly a statute liability. This liability is limited. It is confined to two classes of ways; first, those which the municipality is legally bound to keep in repair, and, second, those as to which they are in law estopped to deny such liability. It is a responsibility which it is not competent for them to assume by contract or otherwise, and the inhabitants of such municipalities cannot be taxed to compensate for injuries sustained by others by reason of the violation of duty assumed on the part of such municipality by contract, but only for the violation of such duties as are imposed by law.
The place where the plaintiff’s injury was sustained is a highway. It is, however, a highway which by reason of legislative enactments necessarily differs from the ordinary ways upon the surface of the country in that region. The Legislature has authorized a raikoad corporation to locate its road in such mode as to cross the highway; and, as it was competent for the Legislature to do, it has prescribed the mode in which the two ways shall cross each other so as to be most safe and convenient to travellers upon either way, and it has prescribed, as it may properly do, the respective rights, duties, obligations and liabilities of *363the parties required to keep the several ways safe and convenient. It has provided that at such crossing the public road shall by means of a bridge pass over the railroad. To accomplish this, abutments are necessary to support the bridge, and approaches must be constructed with a proper slope, from the road-bed as it was to the bridge. By law, these approaches are to be made and kept in repair by the railroad corporation. Gen. Sts. c. 63, § 47. St. 1874, c. 372, §§ 87, 95. As matter of law and of right, the city can in no mode interfere with the construction and repair of such approaches otherwise than an individual might. The place where the injury was sustained was not a way which the city was bound to keep in repair. The St. of 1877, c. 234, § 1, defines the duties of towns in this respect, and contains the same limitation as has been before either expressed or implied in the various statutes upon the subject: “ Highways, town ways, streets, causeways and bridges shall be kept in repair at the expense of the town, city or place in which they are situated, when other provision is not made therefor.” Other provision is made therefor at the place where this injury was sustained. Sawyer v. Northfield, 7 Cush. 490. White v. Quincy, 97 Mass. 430. Wilson v. Boston, 117 Mass. 509.
The plaintiff, however, relies on the agreement of the defendant with the Fitchburg Railroad Company to keep the approaches to the bridge in repair. If that were an agreement which the city was authorized to make, we should be brought to the inquiry whether it was an agreement that a third party could avail himself of, or whether his remedy would be limited to an action against a party only upon whom the law devolved the duty of keeping the way in repair, and whether, if it was competent for the city to make such contract, its liability would be limited to a reimbursement of the railroad company of the damages which it had sustained in consequence of the failure of the city to perform its contract.
The Legislature having prescribed the mode of crossing of the two ways, and having fixed and defined the duties of the two parties in effecting such crossing, it is not perhaps an improper mode of testing the right of the parties inter sese to contract for a change in such duties and liabilities, to inquire whether it would be competent for the city authorities to make an agreement *364to keep the railroad track in repair. It is not probable that any one would contend that a city is authorized to make such a contract, and render its inhabitants liable to taxation for a railroad disaster caused by its failure to fulfil its agreement with the corporation. It is difficult to see how, if by law these parties are competent to make any agreement which shall change the duties imposed by the statute, the limits of such right in reference to the subject matter can be defined.
It is not necessary to consider whether the railroad corporation might make a contract as an individual might, to waive some right, or assume some obligation. The question is confined to the right of the city to make such contract. The city is not a trading corporation. It cannot engage in general business, nor assume any liability except such as the law authorizes. The maintenance of a way is a public duty imposed by law, but it applies only to ways for which other provision is not made.
It is, however, strenuously urged by the plaintiff upon two several and independent grounds, one technically estoppel, the other a liability imposed by statute because of the negligence of the city.
Upon the first ground, it is contended that the city is es-topped to deny its liability, because of having repaired the same within six years prior to the injury. Gen. Sts. a. 44, § 26. That section is in these words: “ If on the trial of an indictment or action brought to recover damages for an injury received by reason of a deficiency or want of repair in a highway, town way, causeway or bridge, it appears that the county, town or person against whom such suit is brought has, at any time within six years before such injury, made repairs on such way or bridge, such county, town or person shall not deny the location thereof/’ It is quite clear that this section of the statute has no application to the facts in the case at bar. Wilson v. Boston, above cited. It provides merely that the existence of 'such a way de jure shall not in that proceeding be denied, but it does not assert that the liability of the party charged to keep it in repair shall not be denied; nor is it by any means clear that under this section of the statute the capacity in which the party acted may not be properly the subject of inquiry. A person may make repairs upon either a county way, town way, or private way, and *365it would hardly be contended that, if he did work upon a towr way under the direction of the proper authorities of the town, and afterward an action should be brought against him foi damages sustained by reason of a defect in it, alleging it to be a private way, he would be estopped to deny either that it was a private way, or that the work was done in his capacity of proprietor of a private way, or to say that he performed the work under a contract with a third party who was the proprietor of the private way, and that he was merely employed to do, by another, what that other was in law bound to do.
The other ground upon which the plaintiff relies with confidence is, that the town, knowing of the existence of this defect, suffered it to remain without notice or warning to the public that it was dangerous, and that therefore the city is liable under the Gen. Sts. e. 43, § 83, because the same was open apparently for public use and for the purposes of a way. But this ground of claim is quite as unfounded as the estoppel. Prior to 1846, ways in this Commonwealth were frequently created by dedication. Individuals would lay out streets over their own land, throw them open' to the public, dedicating them, as it was termed, to public use; and more or less of such use would be deemed an acceptance of the way by the public; and thereafter all such ways would be public ways which the public was bound to keep in repair, and for injuries by reason of defects therein the public would be liable. But by the St. of 1846, c. 203, it was provided that no way opened and dedicated to public use should thereafter become a public charge by reason of such public use, but only after the same should have been laid out and established by the proper authorities under the statutes of the Commonwealth. It was in reference to such ways as these that this provision of law was enacted. It was only to prevent the city or town from having the use and enjoyment of a way without being liable to the incidental duties and obligations of such way, that it was*passed; and by its terms it is confined to such ways, and has no reference whatever to highways lawfully existing. It is immaterial, therefore, in this discussion.
The ruling of the presiding judge was therefore right in all respects, and there must be
Judgment on the verdict.