It is objected that the plaintiffs were not entitled to maintain this action; first, because their negligence contributed to produce the injury for which damages were *304claimed of and paid by them; and secondly, because the damages were paid voluntarily, and not under a judgment recovered against them.
Neither of these objections can be sustained. The first of them must be considered, under the decisions of this court in the cases of Lowell v. Boston & Lowell Railroad, 23 Pick. 24, and Lowell v. Short, 4 Cush. 275, as wholly unfounded. The defendant unlawfully placed a pile of stones within the limits of the highway and near to the travelled road. This obstruction occasioned the injury for which damages were claimed and paid. Although the town were required by law to keep their highway safe and convenient for travellers and all other persons lawfully passing thereon, and became liable for their neglect in this particular to the person who was injured by the obstruction which the defendant had placed in the way, they were under no obligation to him to shield him from the consequences of his own illegal acts. If the person injured had preferred a claim for compensation and indemnity against him, he had no defence under which he could have successfully resisted it. He ought not to be in any more favorable condition merely because the claim in the first instance was made against a party whom he was bound to indemnify and save from loss.
To entitle the plaintiffs to a remedy against one whose unlawful acts had been the means and occasion of subjecting them to a claim for damages which they could not resist, it was not "necessary that they should have refused payment until it was enforced against them under a judgment recovered in an action of law. It is sufficient that the claim was one against which they could make no legal defence. They might yield to an unavoidable liability at once, and then have their remedy over against the party responsible to them; just as a grantee in a deed of conveyance of real estate with covenants of warranty may yield to one having a paramount title, or purchase it in, in order to avoid eviction, and then resort to his warrantor to recover compensation for his loss. Hamilton v. Cutts, 4 Mass. 349. Sprague v. Baker, 17 Mass. 586. The town therefore had a right, without suit against them, to pay the damages *305demanded, if the amount claimed was reasonable and just, and then look directly to the defendant for indemnity. He however would not be concluded as to the amount of damages by the sum paid by the town, but would have the right to have the amount for which he was liable ascertained and determined by a jury, upon the evidence submitted to them in relation to that question. Exceptions overruled.