When the Glorious Revolution overthrew James II king of England, Scotland and Ireland, he fled to France where he was welcomed as an ally to support the Nine Years War which had just started. Most of England and Scotland were loyal to William of Orange but Ireland ruled by Richard Talbot, Earl of Tyrconnell had a nearly all Catholic army which remained loyal to James II.
Only Ulster protestants resisted James’ attempts to regain control and Londonderry and Enniskillen would become the focal points for the first stage of the Williamite War. The garrison in Londonderry was under the control of Viscount Mountjoy, a protestant Loyal to James but Tyrconnell thought the unit was unreliable and ordered it to return to Dublin and be replaced by a unit from Antrim. The city was temporarily left without a garrison after Mountjoy left, when the garrison from Antrim arrived 13 apprentices locked the gates and the garrison from Antrim was not strong enough to take the city by force.
Tyrconnell ordered Mountjoy to return to Londonderry but only 2 of his companies that were entirely protestant were allowed inside. One of those was led by Lieutenant-Colonel Robert Lundy who was appointed governor of city. Over the next 6 months The inhabitants of the city sided with William and Lundy had the gates and the walls repaired and restocked on supplies in preparation for an attack. James landed in Ireland with few solders but money and equipment as Tyrconnell had already raised a large army but lacked supplies, while English ships brought supplies to Londonderry and Lundy officially swore allegiance to William.
In April 1689 Tyrconnell and James sent troops north to retake Londonderry and Lundy choose to meet them at the River Finn to the South but Jacobite cavalry quickly broke through. In the meantime English reinforcements landed in Lough Foyle, Lundy was panicked by his defeat in the south and proposed that the ships not land and the town be abandoned so the ships returned to England and Lundy fled to Scotland disguised as an ordinary soldier.
The Jacobite army reached the city and requested it surrender, the city asked for a delay of two days before a parley and that the army come no closer than St Johnston (about 6.5 Miles southwest). James then approached Bishops Gate and summoned the city to surrender but instead cannons were fired, at the same time reinforcements for the city arrived from the north. Since the city refused to surrender James returned to Dublin and left the rest of the army to place the city under siege till they surrendered.
The Jacobite army surrounded the city, Fort Culmore to the north surrendered and they built a boom across the river Foyle around where the Foyle Bridge is now to prevent ships making it to Londonderry. After a Month and a half under siege disease and hunger took hold and an attempted to relieve the city was made by a small English frigate but it ran aground at Culmore, got damaged by cannon fire and had to retreat. Over the next few months several attempts to relieve the city failed and attacks by the Jacobite army also failed.
At the end of July, the HMS Dartmouth and three merchant ships were sent to bring food to the city, while the Dartmouth engaged Jacobite forces on shore the other ships rammed and breached the boom. The ships landed in Londonderry with much needed food. Seeing as it was no longer possible to starve the city to surrender and not having enough men to storm the city the Jacobite army ended the siege. The siege lasted 105 days and between 4000-8000 people died mostly from disease and hunger.
For more information on the Siege visit the Siege Museum