A period of frightful confusion, known as the presidency of General Acha, ensued. The chiefs fought among themselves with such ferocity that in Chile and Peru the partition of Bolivia was seriously discussed. Finally, at the end of 1864, a remarkable man came to the front out of the tangle. This was the celebrated dictator, Melgarejo, who frankly abandoned all pretence of governing by any sanction except that of brute force and terror. He kept up a great army of spies, and the conspiracies which they reported were ruthlessly crushed by the well-paid ruffians who composed his army and blindly obeyed his capricious commands. One day the dictator, drunk, as was his habit, called the guard and ordered them to jump out of the windows in order to show a visiting foreigner the superior discipline of the Bolivian soldier. Several had broken their arms or legs, but he did not even look to see, and continued his demonstration by ordering his aide-de-camp to "lie dead" like a poodle dog. Taxes were arbitrarily levied; peaceable citizens were exiled and shot; around him circulated a crowd of parasitic functionaries. But in spite of his extravagances and cruelties Melgarejo gave some solidity and consistence to the governmental structure. The production of silver had been declining until about 1850, but at the beginning of Melgarejo's administration had again reached ten millions annually, and thereafter rapidly increased with the encouragement given by him to the investment of foreign capital. Money was freely spent on public works, and the Mollendo railroad, extending to the head of Lake Titicaca, dates from this time. It is the principal route for Bolivia's foreign commerce, though it does not touch Bolivian territory. The isolated desert region on the coast began to be exploited and the guano, nitrate, copper, and silver found there vastly increased the country's revenues, although a considerable foreign debt was incurred.
Melgarejo's enemies succeeded in overthrowing him in 1871, and their leader, General Morales, succeeded to the supreme power. There followed some relaxation of the system of personal tyranny, but in the main the form of the administration changed little, either under Morales or his immediate successors. The first named was able to negotiate a European loan to be employed in the building of railways, and in fact one was constructed--running from Antofagasta on the nitrate coast over the Cordillera and across the Puna table-land to the centre of the country at Oruro. Heavy gradients, the unproductive character of the region along the line, and its length, have prevented its furnishing the cheap and practical outlet to the sea which had been hoped for. Insurrections continued to break out from time to time, and in 1876 General Daza usurped supreme power. His rule lasted until the Chilean war of 1879, but the first decisive defeat was the signal for his fall.