After the war between Paraguay and the allied forces of Brazil and the Argentine and Uruguayan Republics broke out, Thompson offered his services as a military engineer to the Paraguayan President,
Francisco Solano López, in 1865. The offer was accepted and he joined the army in June of that year, taking a prominent role in the war until the end of 1868. At the war's outbreak Thompson was a railway engineer and had no military experience at all. Furthermore, throughout the war, Paraguay's nominal chief military engineer, Hungarian colonel
Wisner de Morgenstern (who had designed the
Fortress of Humaitá) was seriously ill, and so the work fell on Thompson's shoulders. Thus an untried 26-year-old man became the
de facto chief military engineer of the Paraguayan army: Improvising, he used the material and human resources of the country and made earthworks, fortifications and artillery emplacements. His most notable works were the fortifications of Angostura and the trenches – constructed, surreptitiously, overnight, in daring proximity to the Allies' positions – of the Boquerón del Sauce and Curupaity; Angostura held the allied fleet at bay for several weeks, and the Curupaity trenches led to the Allies'
worst defeat of the war. Thompson was promoted to the rank of lieutenant-colonel in the Paraguayan army and received from President López the decoration of
Caballero del órden del mérito (Knight of the
Order of Merit). Although
forced to capitulate at Angostura, the allies allowed him the honours of war, as he refused to surrender at discretion. ==After the war==