The Battle of Almansa took place on 25 April 1707, during the War of the Spanish Succession. It was fought between an army loyal to Philip V of Spain, Bourbon claimant to the Spanish throne, and one supporting his Habsburg rival, Archduke Charles of Austria. The result was a decisive Bourbon victory that reclaimed most of eastern Spain for Philip. The Bourbon army was commanded by the Duke of Berwick, illegitimate son of James II of England, while Habsburg forces were led by Henri de Massue, Earl of Galway, an exiled French Huguenot. This makes it "probably the only battle in history in which the English forces were commanded by a Frenchman, the French by an Englishman." Background Campaigning in Spain and size of the armies involved were limited by logistics to a greater extent than Flanders or Italy. Reliance on local sources for forage and other supplies limited operations in arid areas like Northern Spain, while until the advent of railways in the 19th century, goods and supplies were largely transported by water. Control of the seas allowed the Allies to successfully conduct short-term offensives outside the coastal areas but lack of popular support meant they could not hold territory. The Grand Alliance secured an operations base in Lisbon when Peter II of Portugal changed sides in May 1703, and the following March, Archduke Charles of Austria arrived to head a land campaign. The Bourbon alliance between France and Spain won a series of minor victories along the Spanish-Portuguese border, offset by the British capture of Gibraltar; attempts to retake it were defeated at the naval Battle of Málaga in August 1704, with a land siege being abandoned in April 1705. The 1705 'Pact of Genoa' between English and Catalan representatives opened a second front in the north-east; the Allied capture of Barcelona and Valencia left Toulon as the only major port available to the Bourbons in the Western Mediterranean. An attempt in May 1706 by Philip V of Spain to retake Barcelona failed, while his absence allowed an Allied force to capture Madrid and Zaragossa but they could not be resupplied so far from their bases and were forced to withdraw. By November 1706, Philip controlled the Crown of Castile, Murcia and parts of the Kingdom of Valencia. Over the course of 1706, Allied victories in the Spanish Netherlands and Italy forced the French onto the defensive and