The Spanish armed forces were in a rather parlous state after the Carlist Civil Wars and so on. Nonetheless, with the Monroe Doctrine in abeyance, there were various imperialist ventures in the Americas.
Spain intervened in an ongoing Dominican political fracas, amid fears of the resumption with episodic wars with neighbor Haïti. This time, in the 1860s, Spain attempted to recolonize the Dominican Republic.
The colonial campaign:
https://en.wikipedia.org/wiki/Dominican_Restoration_War
Spain participated in shaking down México alongside Britain and France. The French dictator, Napoleon III infamously attempted to create a proxy state under the rule of the Hapsburg Maximilian von Hapsburg and his Belgian wife Carlota (King Leopold's sister).
From 1864 through 1866, the Spanish navy fought several naval battles against Chile, Ecuador and Peru called the "Chincha islands war"
https://en.wikipedia.org/wiki/Chincha_Islands_War
In the case of attacking Perine mess this is we are in the mu, the Spanish fleet had a seagoing ironclad warship, used in the bombardment of Callao. Small wonder that the United States sold Civil War monitors to Peru postwar, and shipped captured ex-Confederate arms to Mexico.
The Spanish army aped and followed French patterns. So the Modelo 1857 was the Spanish equivalent to the Minié rifle. Like armies everywhere, Spanish officers paid very close and keen attention to small arms developments. Spain was one of the very first, if not the first nation to equip officers with Lefaucheux pin-fire revolvers. In Cuba, the "Pearl of the Antilles," officers had often privately purchased Colt .31 caliber revolvers. There was immediate recognition that some of the arms used in the Civil War portended the future of infantry weapons. After the Civil War, the Col. Hiram Berdan system of converting a muzzle-loading rifle to a breech loader was adopted, and as an economy measure, the Modelo 1857 began to be retrofitted to breech-loading, using a metallic cartridge.
The Spanish monarchy was overthrown and a brief First Spanish Republic ensued. Restive subjects in Puerto Rico and Cuba chose this as an opportune time to revolt. In the case of Cuba, there were very powerful and influential associations of Spaniards, who rejected the Spanish Republic, and also reimposed stark colonial control. These organizations, grouped together as the "Voluntarios"--perhaps a bit like the
pied noirs in Algeria in the 20th-century, had the means and proximity to gun manufactories in the United States to purchase arms and have them shipped. So lots of Rhode Island Peabody breech-loaders, and eventually Remington rolling blocks were purchased. The Cuban insurrectos and political clubs in the United States also purchased arms, although some of these were impounded as violating the Neutrality laws. Much of the armament was Civil War surplus, with a particular preference for the Sharps carbine and rifle, and also the Spencer repeater. Others were surplus rifle muskets and the like.
Late 19th-century Spain had a system of conscription. Any conscript sent overseas to serve in the "Ejército Ultramar" in the colonies, such as North Africa/ Morocco, Equatorial Guinea, mostly the Philippines archipelago, Cuba, or Puerto Rico, was unlucky indeed. These were typically known as "quintos." During times of colonial rebellion, every "fifth" conscript was shipped abroad.
I'll supply some images of the Spanish panoply in subsequent posts to this thread, if interested. The digitization of military archives is far along in Spain, and there is a lot of material available online. I'll focus just on the Civil War period rather than the post-Civil War-era, when Smith & Wesson revolvers, Merwin & Hulbert revolvers, Remington rifles and so on became predominant.