When Henri IV declared war on Spain on 17 January 1595, the kingdom of France was battered and exhausted in the wake of the endless Wars of Religion. Declaring war was a risky move, but it showed Henri's political skills as well as his daring. It was daring because the Spanish infantry formations, the renowned tercios, had long proven their effectiveness on the battlefields of Europe, and they constituted a real danger for Henri's armies. It was a politically savvy move, however, because in declaring war on Spain, Henri IV was killing two birds with one stone – he brought together Frenchmen who had been divided by civil strife to fight a common enemy, and he was able to make the Leaguers who had not rallied to him look like traitors.
The early part of the conflict went well for the French. They defeated the Spanish – who had been joined by Mayenne's League troops – at Fontaine-Française on 5 June 1595. Despite having a much smaller force, Henri showed great audacity. As he accompanied his scouts early one morning, they came across a vanguard of Spanish troops and attacked them with light horse. His victory, which cost him very little in terms of men, created a considerable stir. The king took advantage of this, emphasising in several letters how certain he was that he was under divine protection. An initial message to his sister Catherine de Bourbon mentioned "the grace that God given [him] in combat". A second, addressed to the Parlement of Paris, explained his victory in similar terms, since "glory had to be given to God, from whose hand this great good has come". This initial victory was completed by the conquest of Ham by the troops of Henri de Turenne, maréchal de France, and it allowed Henri to make a triumphal entry into Lyon in September 1595.
Things then turned against the French and the war began to bog down. Under the leadership of the Count of Fuentes, the new governor of the Netherlands, the Spanish won battle after battle. Between 1595 and 1596, they beat the French twice at Doullens (on 24 and 31 July 1595), and captured both Cambrai (October 1595) and Calais (April 1596). Despite the capture of La Fère after a very costly siege (November 1595–May 1596), and despite alliances with Elizabeth I of England (signed at Greenwich in May 1596) and the United Provinces, the situation was delicate for Henri.
Things took a turn for the worse on 11 March 1597. To everyone's great surprise, the Spanish captured Amiens, disguised as walnut merchants. This was a rude shock, because Amiens was strategic to the defence of Paris. Henri IV, overwhelmed, exclaimed, "I have been king of France long enough; now it's time to be the king of Navarre!" He was determined to retake the city at all costs. On 12 March, Henri IV left Paris to lay siege to Amiens. In the wings, Maximilien de Béthune , the future Sully, set about procuring funds and organising the intendancy. The siege lasted five months, at the end of which Amiens surrendered. The war with Spain was as good as won.
Saddled by troubles that were both domestic (financial, economic and social difficulties) and external in nature (the de facto independence of the Calvinist republic of the Netherlands, the fall of Amiens and the burning of the Spanish fleet in the port of Cadiz), Philip II was forced to sue for peace.
The negotiations took place at Vervins-en-Vermandois, under the aegis of pope Clément VIII. Under the terms of the peace treaty, which was signed on 2 May 1598, Spain forfeited all of its recent conquests with the exception of Cambrai. It signalled the return to the situation at it had existed at the time of the Peace of Cateau-Cambrésis , in 1559.
The Peace of Vervins opportunely completed Henri IV's efforts to pacify his kingdom, and it gave France a welcome "springtime of peace" (Janine Garrisson). Having ended his country's civil wars, Henri IV put an end to four decades of more or less direct conflict with Spain. To a certain extent, one could remark that he ended the Wars of Religion by a foreign war, symbolised by the taking of Amiens by Mayenne, the Leaguer who had been "pardoned". The peace was seen as a genuine triumph, and it was celebrated across France with bonfires, processions and Te Deum.