In 1385, Zürich, Zug and Lucerne attacked several Habsburg strongholds and in the following year Lucerne entered into alliances with several Habsburg cities in an attempt to pull those cities into Lucerne's sphere of influence. In response, Leopold III of Austria gathered an army and prepared to invade the Confederation. After a minor battle, a short-lived armistice was declared, but by early July 1386 the Habsburg army was on the move toward the Lucerne city of Sempach. On 9 July 1386 a Confederation force from Lucerne, Uri, Schwyz and Unterwalden met the Austrian army in the Battle of Sempach. While the Habsburg knights initially drove the lightly armored Swiss back, around mid-day the Swiss gained the upper hand and killed Leopold and forced his army to retreat. Much like the Battle of Morgarten, Sempach helped cement the Confederation into a further unified federation. While Schwyz gained no territory from the battle, both Bern and Lucerne gained significant territories at the expense of the Habsburgs.