If there is a legacy maintenance agreement and a will at the same time, if there is no conflict between the agreement and the will, the estate shall be handled in accordance with the agreement and the will respectively, if there is conflict, the legacy shall be handled in accordance with the legacy maintenance agreement, and if there is conflict between the will and the legacy maintenance agreement, the will shall be invalid.
Article 5 of the Opinions of the Supreme People's Court on Several Issues Concerning the Implementation of the Inheritance Law: The decedent signed a legacy maintenance agreement with others before his life and at the same time made a will;
After the beginning of succession, if there is no conflict between the legacy maintenance agreement and the will, the estate shall be treated according to the agreement and the will respectively; If there is any conflict, it shall be handled according to the agreement, and the wills in conflict with the agreement shall be invalid in whole or in part.