In 1471 Marfa and her sons, Dmitrii and Fedor, as the last representatives of the anti-Muscovite Boretsky family, attempted to negotiate with Casimir IV Jagiellon the terms of the city's handover to the Grand Duchy of Lithuania, provided that the city's ancient privileges and rights will be retained. They also invited Mikhailo Olelkovich to become city's ruler. On hearing about Marfa's manoeuvres, which violated the earlier Treaty of Yazhelbitsy, Ivan III advanced against Novgorod and defeated the Novgorodian volunteer army in the Battle of Shelon. In the wake of this disaster, Marfa's son, Dmitrii was executed on July 24, 1471 at the behest of the grand prince.