On March 17, 1861, Santana announced the annexation of the Dominican Republic by Spain. A number of conditions had combined to bring about this reversion to colonialism. The Civil War in the United States had lessened the Spanish fear of retaliation from the north. In Spain itself, the ruling Liberal Union of General Leopoldo O'Donnell had been advocating renewed imperial expansion. And in the Dominican Republic, both the ruler and a portion of the ruled were sufficiently concerned about the possibility either of a renewed attack from Haiti or of domestic economic collapse to find the prospect of annexation attractive.
Support for annexation did not run as deep as Santana and his clique had represented to the Spanish, however. The first rebellion against Spanish rule broke out in May 1861, but it was quashed in short order. A better organized revolt, under the leadership of the baecista, General Sánchez, sprang up only a month later. Santana, now bearing the title of captain general of the Province of Santo Domingo, was forced to take to the field against his own countrymen as the representative of a foreign power. The wily Santana lured Sánchez into an ambush, where he was captured and executed. Despite this service, Santana found his personal power and his ability to dole out patronage to his followers greatly restricted under Spanish rule. In a fit of pique, he resigned the captaincy general in January 1862.
Resentment and rebellion continued, fed by racial tension, excessive taxation, the failure to stabilize the currency, the uncompensated requisition of supplies by the Spanish army, heavyhanded reform of local religious customs by an inflexible Spanish archbishop, and the restriction of trade to the benefit of the Spanish empire. The Spaniards quelled more uprisings in 1863, but guerrilla actions continued. In response to the continuing unrest, a state of siege was declared in February 1863.
Rebellious Dominicans set up a provisional government in Santiago, headed by General José Antonio Salcedo Ramírez, on September 14, 1863. Their proclamation of an Act of Independence launched what is known as the War of Restoration. For their part, the Spanish once again turned to Santana, who received command of a force made up largely of mercenaries; however, this campaign was the last for the old caudillo. By this time, his popularity had all but disappeared. Indeed, the provisional government had denounced Santana and had condemned him to death for his actions against his countrymen. On June 14, 1864, a broken and despondent Santana saved the rebels the trouble of carrying out their sentence. The timing of his death lent credence to speculation that he had committed suicide, although this belief was never proven.
Meanwhile, the guerrilla war against the Spanish ground on. The rebels further formalized their provisional rule by replacing Salcedo (who had advocated the return of Báez to rule a restored republic) and by then holding a national convention on February 27, 1865, which enacted a new constitution and elected Pedro Antonio Pimentel Chamorro president.
Circumstances began to favor a Spanish withdrawal. The conclusion of its Civil War promised that the United States would make new efforts to enforce the Monroe Doctrine, which barred European powers from the Western Hemisphere. Spanish military forces, unable to contain the spread of the insurrection, lost even greater numbers of troops to disease than they did to the guerrillas. The O'Donnell government had fallen, taking with it any dreams of a renewed Spanish empire. On March 3, 1865, the Queen of Spain approved a decree repealing the annexation of Santo Domingo.