In 1854, a civil war erupted in Nicaragua between the Legitimist party (also called the Conservative party), and the Democratic party (also called the Liberal party). The Democratic party sought military support from William Walker who, to circumvent American neutrality laws, obtained a contract from Democratic president President Castellón to bring as a large number of as three hundred "colonists" to Nicaragua. Walker sailed from San Francisco on May 3, 1855, with approximately 60 men. Upon landing, the force was reinforced by 170 locals and about 100 Americans.
Establishment of Walker
With Castellón's consent, Walker attacked the Legitimists in the town of Rivas, near the trans-isthmian route. He had been driven off, but not without inflicting heavy casualties. On September 4, throughout the Battle of La Virgen, Walker defeated the Legitimist army. On October 13, he conquered the Legitimist capital of Granada and took effective control of the country. Initially, as commander of the army, Walker ruled Nicaragua through puppet President Patricio Rivas. U.S. President Franklin Pierce recognised Walker's regime as the legitimate government of Nicaragua on May 20, 1856.
Central American Counterattack
Walker had scared his neighbours with talk of further military conquests in Central America. Juan Rafael Mora, President of Costa Rica, rejected Walker's diplomatic overtures and instead declared war on his regime. Walker sent Colonel Schlessinger to invade Costa Rica in a preemptive action, but his forces were defeated at the Battle of Santa Rosa in March 1856. Vanderbilt financed and trained a military coalition of these states, led by Costa Rica, and worked to prevent men and supplies from reaching Walker. He additionally provided defectors from Walker's army with payments and free passage back to the United States of America. In April 1856, Costa Rican troops and American mercenaries supported by Vanderbilt penetrated into Nicaraguan territory and inflicted a defeat on Walker's men at the Second Battle of Rivas, in which Juan Santamaría, later to be recognised as one of Costa Rica's national heroes by burning the place were the Filibuster were staying. Walker set himself up as President of Nicaragua, after conducting an uncontested election. He had been inaugurated on July 12, 1856, and soon launched an Americanization program, declaring English an official language and reorganising currency and fiscal policy to encourage immigration from the United States of America.
Meanwhile, government representatives from Honduras, El Salvador and Guatemala signed in the City of Guatemala a Treaty of Alliance on July 18, 1856, for "defense of its sovereignty and independence" additionally recognised Patricio Rivas as president of Nicaragua. Costa Rica couldn't attend at that time to the alliance because of the havoc that cholera disease had caused in their troops, but would resume actions later. Also, democratic and loyalist factions allied to Patricio Rivas, signed on 12 September, a "Providential Pact" declaring war against William Walker. For September 14, Septentrión Army (as the allied army was called) forces managed the first victory of the patriots Nicaraguans in the so-called Battle of San Jacinto.
Walker's army had though been weakened by an epidemic of cholera and massive defections, it was no match for the Central American coalition.
By the end of 1856, Walker ordered the destruction of Granada at the end of a fateful site.
On May 1, 1857, Walker surrendered to Commander Charles Henry Davis of the United States Navy and was repatriated. Upon disembarking in New York City, he had been greeted as a hero, but he alienated public opinion when he blamed his defeat on the U.S. Navy.
- June 29: First Battle of Rivas, Nicaraguan legitimista troops side's defeat Walker.
- August 30: filibuster troops take port San Juan del Sur.
- September 3: Battle of La Virgen, Walker victory over troops of Jose Santos Guardiola.
- October 13: capture of the city of Granada by Nicaraguan democratic troops supported by filibusters.
- March 20: Battle of Santa Rosa in Costa Rican territory.
- April 11: Second Battle of Rivas: Costa Rican troops repels the attack . It highlights the soldier Juan Santamaría.
- April 26: Costa Rican troops leave Nicaragua, decimated by cholera disease.
- September 14: Victory of Nicaraguan patriots on filibusters in the Battle of San Jacinto (1856).
- September 22: William Walker decrees legalising slavery in the country.
- November 7: Costa Rican troops under the command of José María Cañas occupy San Juan del Sur.
- 11 to 13 October: First Battle of Masaya: The Allied Centralamerican Army repels the filibuster troops.
- November 12: troops under William Walker defeated José María Cañas.
- 15 to 19 November: Second Battle of Masaya, American allies reject the troops of William Walker.
- November 24 to December 14: destruction of Granada.
- December 16: Walker took the city of Rivas.
- December: Costa Rican troops began a series of attacks that take river steamers in San Juan del Norte and the river San Juan, and the fortress of El Castillo and San Carlos.
- Jan. 3: Costa Rican troops take the steamer "San Carlos", isolating the government of William Walker by the Atlantic Ocean.
- 28 January: Allied troops occupy the lake port of St. George.
- March 5: Nicaraguan and Central American troops under the command of Fernando Chamorro Alfaro and Florencio Xatruch respectively, defeat the filibusters in the Battle of The Jocote.
- March 23: Third Battle of Rivas, CentralAmerican allies attack the village without results.
- April 11: Fourth Battle of Rivas, CentralAmerican allies again attack the village without results.
- April 17: Centralamerican Allied troops occupy San Juan del Sur.
- May 1: William Walker surrenders to U.S. Captain Charles H. Davis.
- May 5: William Walker abandons Nicaragua.