Ronan, J.
This is a petition by the trustee under the will of Grace E. Winslow for instructions as to who should be paid a bequest of $500 and a share in the residue, which a codicil of the, will provided should be paid "to the Town of Shirley aforesaid to be held by them, as a fund the income thereof to be used for the maintenance of a Home for the Poor.” The town appealed from a final decree stating that this bequest had lapsed and ordering payment thereof to the respondent Marjorie Carpenter. The latter is the surviving individual residuary legatee.
The testatrix died May 25, 1915, leaving a daughter as her only heir and next of kin, for whose benefit her will established a trust out of residue and provided for the termination of the trust and the distribution of the trust property upon the happening of certain events which have now occurred. The daughter died on June 15, 1943. The case was heard in the Probate Court upon a statement of agreed facts from which it appeared that the town, at a special meeting on August 7, 1944, voted to accept the bequest. It also appeared that the town does not have a permanent home for the poor or funds for the establishment of such a home.
The appellee contends that the gift has failed because it is impossible for the town to execute the trust and because the will does not show any general charitable intent that the gift should be used for some other charitable purpose, and that the fund should be paid to her. It is-well settled that, if it appears from the will that the testatrix intended that her charitable purpose should be limited to a specific object or to a designated institution and it becomes impossible to effectuate that object or the institution has ceased to exist, and there is no general charitable intent that her property should be used for a charitable purpose similar to the charitable nature of that described in the will, then the gift fails in the absence of any limitations over or other provision and the heirs dr next of kin of the testatrix takejjby way of resulting trust. Teele v. Bishop of Derry, 168 Mass. 341, 343. Holmes v. Welch, 314 Mass. 106, 109-110.
A gift for the relief of poverty is a valid public charity, *80and a city or town has the power to accept a trust for the benefit of the poor and to act as trustee and to execute the trust. Higginson v. Turner, 171 Mass. 586. Attorney General v. Lowell, 246 Mass. 312. Boston v. Curley, 276 Mass. 549. Boston v. Dolan, 298 Mass. 346. The town has decided to become the trustee by a vote which shows that it was familiar with the terms of the trust, and consequently the town must have realized the nature of the duties that would be imposed upon it in the administration of the trust. This vote cannot be interpreted otherwise than as an expression by the town of its willingness to accept and manage the trust in the manner designated by the testatrix and for the accomplishment of the purpose that she intended. It cannot be assumed, from the fact that the town has not yet established a home for the poor, that it will abandon its duties as a trustee or attempt to repudiate the fiduciary duties that it has willingly proposed to undertake. While the amount of the trust fund does not appear in the record, no reason appears why the town may not acquire, by purchase or otherwise, a home of modest size for the benefit of some of its poor and apply the income from the trust fund toward the maintenance of this home. The terms of the will are clear. No question concerning the application of the cy pres doctrine arises in the present circumstances. The vote of the town was a valid acceptance of the trust. It could not thereafter disclaim. American Academy of Arts & Sciences v. Harvard College, 12 Gray, 582, 595. Drury v. Natick, 10 Allen, 169, 183. Am. Law Inst. Restatement: Trusts, § 102 (2). The acceptance of the office of trustee carries with it the responsibility to administer the trust fully and faithfully in furtherance of the charitable purpose for which the funds were donated. Attorney General v. Lowell, 246 Mass. 312, 324. MacDonald v. Street Commissioners of Boston, 268 Mass. 288, 296. A completed gift duly accepted by the town constitutes a contract between the town and the estate of the testatrix which, of course, the town would have no right to repudiate. Cary Library v. Bliss, 151 Mass. 364. Adams v. Plunkett, 274 Mass. 453, 462-463.
*81The administration of the trust by the town must be in accordance with the terms of the will, and the town cannot for reasons of convenience or economy, or for any other reason, deviate from the purposes of the trust, the enforcement of proper administration of which is the exclusive function of the Attorney General. G. L. (Ter. Ed.) c. 12, § 8. Judkins v. Hyannis Public Library Association, 302 Mass. 425, 427. Elias v. Steffo, 310 Mass. 280, 284.
The final decree must be modified by striking out the words “that the bequest to said Town of Shirley lapsed; and that said petitioner pay the sum bequeathed to said town to said Marjorie Carpenter,” and substituting therefor an order to pay the bequest to the town. The decree as so modified is affirmed. '
So ordered.