The fighting was caused by the arrival of William Walker in Nicaragua. Walker was an American soldier who believed slavery was good. He told the people of Nicaragua that he wanted to help the country. What he really wanted was to conquer the five free nations of Central America. The president of Costa Rica, Juan Rafael Mora Porras thought that Walker wanted to conquer them. On February 27, 1856, Mora declared the war against Walker and Nicaragua.