Following the successful defence of Derry and the Siege of Carrickfergus, the Jacobites had lost control over the north of Ireland by late 1689. Their defeat at the Battle of the Boyne on 1 July 1690 saw their forces make a disorderly retreat from the eastern part of the country, abandoning the capital Dublin in the process. James II himself had fled Ireland for France, judging his military prospects there to be hopeless. The Irish Jacobites still in the field found themselves in the same position as the Catholic Confederates of a generation before – holding an enclave behind the river Shannon, based on the cities of Limerick and Galway. The main Jacobite army had retreated to Limerick after their defeat at the Boyne.