The Battle of Lens (20 August 1648) was the last major battle of the Thirty Years' War and a major French victory during the Franco-Spanish War. A Spanish army of 18,000 troops under Archduke Leopold Wilhelm of Austria, the Governor of the Spanish Netherlands, set out to recapture the city of Lens in Artois from France, which had captured it in 1647. The French were distracted by the Fronde uprising and the campaign in Catalonia, so the Prince de Conde and his army of 16,000 French troops were forced to rush north to confront the invading Spanish army. The Spanish had superior numbers and the high ground, so Conde lured the Spanish into an ambush; the Spanish assaulted what was supposedly the French rear guard, but stronger French cavalry forces arrived and repelled the Spanish cavalry. The Spanish infantry fought well, inflicting heavy losses on the French, but they were encircled and massacred as they had been at the 1643 Battle of Rocroi. The Spanish forces either withdrew or surrendered, and the French won a great victory. Philip IV of Spain had lost his main army, and his ally, Ferdinand II of Germany was forced to surrender to the Franco-Protestant alliance as the French advanced on Prague in Eastern Europe; France made peace with the Holy Roman Empire, but it would remain at war with Spain until 1659.