Ferdinand died on 25 July 1564, and his son Maximilian II succeeded him. The Transylvanian Diet declared war to reoccupy the counties that had been lost to the Habsburgs in 1562. John Sigismund's army seized Szatmár (now Satu Mare in Romania), Hadad and Nagybánya (now Baia Mare in Romania) before the end of 1562, but a counter-invasion by Lazarus von Schwendi reached the river Szamos in March 1565. The envoys of John Sigismund and Maximilian II concluded a treaty in Szatmár on 13 March 1565 in which John Sigismund renounced his title of king in return for the recognition of his hereditary rule in Transylvania John Sigismund was also to marry Maximilian II's sister, Joanna.