The instability in Central America after the collapse of the Federal Republic of Central America forced Costa Rica to reform and modernize its army, especially after a threat of invasion from Nicaragua in 1848. With the arrival of Juan Rafael Mora Porras as president in 1849, Costa Rica acquired between 500-2000 1853 Enfield rifles in 1855. Later that year, the adventurer and mercenary William Walker imposed a military dictatorship in Nicaragua, reimposing slavery and threatening to conquer all of Central America. The 1853 Enfield rifle was used in the Filibuster War exclusively by the Costa Rican army, beginning with the Battle of Santa Rosa and the Second Battle of Rivas in March and April 1856.