WI: Spain wins the Chincha Islands War (1864-66)

How could Spain achieve victory in the Chincha Islands War against Chile and Peru?
If this is possible, then what happens to not only South America, but also spanish politics? Will the first republic still rise? Is the Third Carlist War butterflied away?
 
Spain can win the war if it can secure a decisive victory over the allied fleet. Once Spain has that victory it bombard the allied countries' ports and harass their shipping. In this situation the allied countries will be forced to come to terms.

Regarding Gibraltar, that proposal was a pipe-dream. There was little chance of Britain accepting it. However if Britain did they could also buy the Galápagos Islands from Ecuador (they were heavily in debt and offered to sell the them to multiple countries).
 
How would the South American countries react if Spain has a new foothold in the region?
IOTL, there was a naval arms race between Brazil, Chile, and Argentina in the region. Could Spain end up joining the fray?
 
Top