By 1789 Saint-Domingue was a very wealthy colony, heavily coveted by England, which then overtook Port-au-Prince. It was in this moment of unrest in 1793 that the slaves, led by a brilliant ex-slave, Toussaint L’Ouverture, allied with the Spanish to revolt against the French. But when the French government made a counteroffer to the slaves that slavery would be abolished if they joined again with the French to defeat the encroaching British forces, Toussaint returned to the French side along with his army.
With the French, Toussaint and his men successfully defeated both British and Spanish forces. The British finally withdrew from the island entirely in 1798, and in 1801 Toussaint (without direction from the French government) took control of Santo Domingo  for the French Republic. In 1802, Napoleon’s French Imperialist forces invaded to try to reinstate the pre-revolutionary climate. Toussaint was eventually captured by the French and sent to Paris, where he died of pneumonia in 1803.
The revolutionary war continued under Toussaint’s successor, Jean Jacques Dessalines, and in 1804 Haiti won its independence. It was the second independent country and the first black republic in the New World.
While the French were forced out of the western side of the island, they remained present in Santo Domingo until 1809, when they finally returned it to Spanish control. At that point the colony of Santo Domingo declared its independence and requested to join the Gran Colombia Federation, a South American anticolonial movement run by Simón Bólivar. But that request was never realized because Haiti jumped in and invaded in 1822 and stayed for 22 years under the Haitian president Jean-Pierre Boyer. The 22-year Haitian occupation is a sore spot between Dominicans and Haitians even to this day. Boyer was a hard-handed leader who expressed outrage and discontent toward the former Spanish colony.
On February 27, 1844, Juan Pablo Duarte, with the help of his separatist movement, La Filantrópica (The Philanthropy), captured Santo Domingo  at the Puerto del Conde and claimed independence. Duarte, who was widely supported to be the president of the new republic, was then forced into exile by Pedro Santana, who led the troops that were in favor of returning to Spanish rule. Two decades of Spanish rule ensued.
Finally, in 1865, independence fighters reclaimed control in what is now called La Guerra de la Restauración (The War of the Restoration). And on March 3, 1865, the queen of Spain finally withdrew all her soldiers from the island.
The new rulers soon encountered internal strife and within six months they were ousted from power. The Dominican Republic  fell into the era of caudillos, strongmen who ruled areas as if they were personal fiefdoms complete with armies made up of local peasants. These men were more concerned with getting rich in their own area than for the betterment of the country as a whole. To keep the people in line, their armies strong and themselves in power, they used fear as a tool by keeping the constant threat of a Haitian invasion. The oldest political trick in the book.
During the age of the caudillos, leadership of the country was a tennis match switch-up of civil war between the armies of General Pedro Santana and General Buenaventura Báez, fighting back and forth for control of the government. The Dominican economy was devastated by Santana and Báez printing pesos and the civil war. Currency was worthless. Baez went into exile and Santana declared himself president and pleaded for Spanish annexation. The Dominican Republic was annexed to Spain once again in 1861 and they immediately began to phase out the Dominican governing leaders. The Dominican populace felt the sting as their rights began to gradually slip away, and as a result rebel forces kicked off La Guerra de la Restauración (The War of Restoration) in February 1863. The Dominican rebels succeed in showing the Spaniards the way off the island in July 1865.
Enter the second wave of caudillos. After the War of Restoration, many were grappling for control of areas and depending on various natural resources like mahogany, tobacco, farming, and cattle ranching. Between 1865 to 1870 there were 20 changes in government, but in 1869 Buenaventura Báez became president again and he tried to sell the Dominican Republic to the United States for US$150,000. Even though U.S. President Ulysses S. Grant was all for it, and Presidente Báez signed the treaty, the agreement was defeated in the U.S. Senate.
In 1882, General Ulysses Heureux (known as Lilí) began his brutal dictatorship. He had borrowed a lot of money from the United States and Europe to finance his army (as well as to bulk up the sugar industry), but he ground the Dominican economy into a pulp and brutalized the people so harshly that he was assassinated in 1899. This caused constant rock and sway of individuals coming into power and overthrowing one another, causing general chaos and corruption in the Caribbean nation and turning the heads of the Americans, who had great interest in the sugar industry. The U.S. took control of the Dominican customs houses and demanded payment of the loans. After two years, the debt was reduced to a treaty, which helped the Dominican Republic  get back on its shaky economic feet, thanks in part to the booming sugar industry.
In 1914, U.S. President Woodrow Wilson demanded that the two bickering (and fighting) sides, the Horacistas (supporters of Horacio Vásquez) and the Jimenistas (supporters of Juan Isidro Jimenes) stop and pick a president of the country. To press the point, U.S. military landed in Santo Domingo  in 1916 and stayed until 1924, eventually taking over complete control. They disbanded the Dominican army, allowed all incoming American products to come through customs tax-free, created a domineering National Police Force, disarmed the people, and installed a puppet government, who answered to the U.S. Marine commanders. They also organized a tax system, built highways, improved education, and organized other institutional reforms.