Spain had been expelled from nearly all Latin America in the early 1820s, but had designs on a return. This might have seemed a pipe dream, but they were about to have an incredible piece of luck - part of the old empire was about to ask to return.
Hispaniola had been Spanish since the days of Christopher Columbus, but the Western third was later taken over bu the French, resulting in two culturally different regions that we now know as the Dominican Republic and Haiti. The Haitians, remarkably, threw off french rule, the Dominicans declared independence in 1821, and were almost immediately invaded by Haiti. Haitians were expelled in 1844 and there followed years of chaos, dictatorships and repeated Haitian invasions. Thus by the late 1850s people were looking around for an alternative.
The US had had designs on Santo Domingo for years, primarily the harbour at Santana, which would give the US a naval base in the centre of the Caribbean. The Spanish, British and French were opposed to any American takeover for exactly the same reason. In the 1850s though interest intensified as the American Secretary of State, Seward attempted to drag the US into a confrontation with Spain to distract the southern States from talk of Independence. Lincoln though refused to be deflected from internal politics.
A better alternative, from the viewpoint of the Spanish elite, was a return to Spain itself - strong enough to withstand Haiti, but not so strong as to absorb them completely. Consequently in 1859 a representative of the current dictator, Santana, approached the Spanish court to establish a protectorate over the island, fortifying it against any American incursions. Increasing American official and unofficial pressure caused Sanatan to ask for direct Spanish rule, under certain conditions, especially a guarantee Spain would never reestablish slavery, one of the worries about the United States. Annexation as the Spanish Maritime Province of Santo Domingo was announced in cathedral square on March 18 1861,
It should have gone so well, the easiest conquest in history. If Santo Domingo was not actually enthusiastic for Spanish rule, it was on the whole prepared to accept it. Two small rebellions were crushed and yet another invasion from Haiti ambushed and destroyed by government forces with out the Spanish needing to do anything. Unfortunately the Spanish played their hand badly, very badly.
Many government officials were removed from office and replaced by Spanish officials from Cuba and Puerto Rico. Santana's cronies they might have been, but at least they understood the country. Even worse, many of the Dominican militia officers who had fought off the Haitians were considered not even worthy to wear Spanish uniforms, alienating many of Spain's natural allies. This was mirrored in society as a whole. Many Dominicans at all levels were mixed race to a degree, and many marriages were made outside the catholic church. Spanish officials, especially those from Spain itself, disdained contact with those not of European blood, who they considered inferior, and a new archbishop declared that all non-Catholic marriages invalid and the children therefore bastards. With these and other measures Spain alienated virtually all classes of society with incredible speed. The Dominicans had been fighting Haiti, and each other, for generations, the result was inevitable.