The plaintiff was injured by falling into an unguarded trench four or five feet deep, dug by the water department of the city of Medford, in the street, across the track of the defendant’s railway. The accident happened in the evening. The parties filed in the case the following admission or agreement in writing: “In the above entitled case, the defendant, Boston Elevated Railway Company, hereby admits that the trench referred to in the plaintiff’s declaration was upon the night mentioned in said declaration in charge of a man paid by the defendant and that the said man was sent out to guard said trench during said night by the defendant in accordance with an agreement with the water department of the city of Medford. The said trench was not dug by the defendant but by the said water department, but the said trench crossed the tracks of the defendant and rather than have the said department place wooden barriers along the side of the trench, which it would be necessary to remove and replace as each car went by, the defendant made the above agreement and sent out the man as above stated.” It was undisputed that the man sent out under this agreement failed in his duty to guard the trench, and that the plaintiff was injured while in the exercise of due care. The only question before us is whether there was evidence of negligence on the part of the defendant or its servant, on which the plaintiff can maintain her action.
The defendant was not primarily liable for the condition of the street, and originally it was under no obligation to guard the trench. Leary v. Boston Elevated Railway, 180 Mass. 203. The action is not brought under the R. L. c. 51, § 18, and the provision of § 20 of this chapter, requiring notice of the injury to the county, city, town or person by law obliged to keep the way in repair, is not applicable to this case. Seltzer v. Amesbury & Salisbury Gas Co. 188 Mass. 242. But the defendant had an interest to be relieved from the necessity of removing and replacing a barrier every time one of its cars passed along the track, and if the city had performed its duty to protect travellers from danger at that point, the most convenient and feasible way of doing it would have been by the erection of barriers. In its own interest, and to save itself from trouble, the defendant entered into the arrangement with the city to guard the trench in *288such a way as would render barriers unnecessary. It thereby assumed a relation to this danger in the street that imposed upon it a duty to protect travellers from the danger. This duty extended to every one who was liable to be affected by the defendant’s performance or non-performance of it. The contract with the city, whereby the defendant undertook to relieve the city of the performance of its statutory duty, brought the defendant into a relation to these travellers which was the foundation of a legal obligation to provide for their safety.
After making this arrangement, the business of guarding the trench was the defendant’s business, and the man sent to do it was the defendant’s servant, for whose negligence, either of omission or commission, the defendant was liable. Brow v. Boston & Albany Railroad, 157 Mass. 399. Boucher v. New York, New Haven, & Hartford Railroad, 196 Mass. 355, 358.
Judgment on the verdict.