The position was admirable for defence. North of the Paraná and east of the Paraguay stretched a low, wooded country subject to overflow, and intersected by shallow, mud-bottomed lagoons, which were old abandoned beds of the rivers. The Paraguay protected his right flank and afforded him a direct and easy communication with Asuncion. Batteries on the point of Humaitá, which the Brazilian fleet did not dare to try to pass, insured this line of communication. West of the Paraguay the great Chaco, there impenetrable, prevented a movement to get north of Humaitá on that side. To the east the swamps along the Paraná extended indefinitely, and an advance of the enemy in that direction would have had its communications cut by an army encamped near Humaitá. Humaitá was, therefore, the key to the situation, and the allies could not advance until they captured it or, by running the batteries with their fleet, destroyed Lopez's control of the Paraguay.
By March, 1866, the allies had concentrated a force of forty thousand men just south of the fork of the rivers. About twenty-five thousand were Brazilians, twelve thousand Argentines and three thousand Uruguayans. The Brazilian fleet, numbering eighteen steam gunboats carrying one hundred and twenty-five guns, lay near at hand ready to co-operate. Protected by the fire of the gunboats, the whole allied army had little difficulty in crossing the Paraná and establishing itself on Paraguayan soil. Lopez lost heavily in vain attempts to prevent this landing. On May 2nd, a force of Paraguayans surprised the allies a few miles north of the river and badly cut up the vanguard. The allies, however, continued advancing and took a strong position just south of a great lagoon. Here, on the 24th of May, they were attacked by the whole Paraguayan army of twenty-five thousand men, who fought with desperate valour, but at a hopeless disadvantage. A quarter of the Paraguayan soldiers were left dead on the field, and another quarter were badly wounded, while the loss of the allies was half as great. The Paraguayan army was apparently destroyed, but the allies had suffered so severely, and the difficulties of transportation through the swamps were so great, that they did not make the sudden dash upon the trenches at Humaitá which might have ended the war. Lopez did his utmost to reorganise his army. Practically the whole male population was impressed into service. The river line of communication to Asuncion, and the strategic railroad thence up into the most fertile and populous interior of the country, enabled him comfortably to command all the resources of the country, both in men and provisions.
Humaitá had already been well fortified on the land side, and Lopez now threw up the trenches at the top of the bluff at Curupayty, the first high land on the Paraguay River north of the allied army and south of Humaitá, and connected it with the latter fortress. Lopez had the advantage of the services of a clever English civil engineer; and the fortifications, though rude, were soon made practically impregnable to assault. In spite of their defeats, the Paraguayans were as ready as ever to attack when Lopez commanded, or to stand up and be shot down to the last man. They were the most obedient soldiers imaginable; they never complained of an injustice and never questioned an order when given. Even if a soldier were flogged, he consoled himself by saying, "If my father did not flog me, who would?" Every one called his superior officer his "father," and Lopez was the "Great Father." Each officer was responsible with his life for the faithfulness and conduct of his men and had orders to shoot any that wavered. Each soldier knew that the men who touched shoulders with him right and left were instructed to shoot him if he tried to desert or fly, and those two knew that the men beyond them would shoot them if they failed to kill the poor fellow in the centre of the five. This cruel system answered perfectly with the Paraguayans, and to the very end of the war they never refused to fight steadily against the most hopeless odds.
Meanwhile, the allies awaited reinforcements and supplies in the noisome swamps, dying meantime by thousands of fever. By the end of June, when the allies finally determined to assault the fortifications around Humaitá, Lopez had twenty thousand men on the ground. After some bloody and indecisive fighting in the swamps, General Mitre, the Commander-in-Chief, ordered a grand attack upon the entrenchments at Curupayty. On the 22nd of September, 1866, it began with the bombardment by the Brazilian ironclads. Eighteen thousand men in four columns advanced from the south, and threw themselves blindly against the fortifications. When they came to close quarters they were thrown into disorder by the terrible artillery fire from the Paraguayan trenches, which cross-enfiladed them in different directions. The enormous canisters discharged from the eight-inch guns point-blank, at a distance of two or three hundred yards, wrought fearful execution. The rifle fire of the allies was useless, and the Paraguayans simply waited behind their trenches until the Brazilians and Argentines were close at hand and then fired. The allies retired in good order, after suffering a loss of one-third their number. The soldiers obediently kept rushing on to certain death until their officers, seeing that success was hopeless, told them that they might retreat. The courage of the Paraguayans had been proved in their unsuccessful assaults on the allies the year before, and now the Argentines and Brazilians showed even in this awful defeat what a stomach they, too, had for hand-to-hand fighting.
After the battle of Curupayty, nothing was attempted on either side for fourteen months. Both sides had had enough of attacking fortified positions. The Paraguayans lay in Humaitá and the allies occupied themselves with fortifying their camps. The imperial government made tremendous exertions to reinforce the army. The Argentines also did their best, but the efforts of both were hardly sufficient to make good the terrible ravages of the cholera, which by the beginning of May, 1867, had put thirteen thousand Brazilians in hospitals. It was not until July that the allies felt themselves again ready to take the offensive. A division marched up the Paraná with the purpose of outflanking Humaitá on the east, while cavalry raids were sent out to the north and rendered the outlying positions of the Paraguayans unsafe. Finally, in November, 1867, the Brazilian troops succeeded in getting over to the Paraguay River, north and in the rear of Lopez, and General Barreto captured and fortified a strong position on the bank fifteen miles north of Humaitá. This was fatal to the security and communications of Lopez. He made one more desperate and unsuccessful assault on the main position of the allies, and then began to plan to retire toward Asuncion. At the same time the Brazilian ironclads passed the batteries at Curupayty, compelling Lopez to withdraw his troops up the river to Humaitá. The war became virtually a siege of the latter place, which was constantly bombarded by the fleet from the front and by the army from the rear. The Brazilian position on the river to the north cut Lopez off from direct river communication with Asuncion, and he had to transport his supplies on a new road built in the Chaco swamps. He began preparations to evacuate Humaitá and retreat to the north. In January, 1868, Mitre definitely retired from the command of the allies and was succeeded by the Brazilian Marshal Caxias. A month later (February 18th) the Brazilian fleet of ironclads finally succeeded in running the batteries at Humaitá, and after throwing a few bombs at Asuncion, devoted themselves to the more useful task of cutting off the transports to Lopez's army.
Lopez's line of river communication was now completely at the enemies' mercy, and a large force could not be maintained at Humaitá. He transported his army to the right bank of the Paraguay, recrossing when he got beyond the Brazilian positions. The garrison of three thousand men which he left at Humaitá defended itself for six months. In the meantime, he had fortified a new position less than fifty miles from Asuncion and accessible across the country from his base of supplies in central Paraguay. On his right flank a river battery was erected which again prevented the Brazilians from reaching the upper river. Opposite this point, however, the Chaco is penetrable, and Caxias landed a force on the west bank and, marching up, crossed the river in the rear of Lopez's position. The Brazilians closed in from the north and south on the few thousand Paraguayans, who were all that survived, and after several days of desperate fighting, December 27, 1868, the Brazilians carried Lopez's position and he fled for his life to the interior, followed by a thousand men.
Even after such a defeat he was indomitable and succeeded in gathering another small army which was pursued and destroyed in August, 1869. Lopez again escaped and took refuge in the wild and mountainous regions in the north of Paraguay. The Brazilian cavalry pursued him relentlessly, but it was not until March 1, 1870, that he was caught. In an attempt to escape he was speared by a common soldier.