Title: Dominican Republic
Content:  Haiti in 1804. After more than three hundred years of Spanish rule, the Dominican people declared independence in November 1821. The leader of the independence movement, José Núñez de Cáceres, intended the Dominican nation to unite with the country of Gran Colombia, but the newly independent Dominicans were forcefully annexed by Haiti in February 1822. Independence came 22 years later in 1844, after victory in the Dominican War of Independence. Over the next 72 years, the Dominican Republic experienced mostly civil wars (financed with loans from European merchants), several failed invasions by its neighbour, Haiti, and brief return to Spanish colonial status, before permanently ousting the Spanish during the Dominican 
Title: Dominican Republic
Content:  After a dozen years of discontent and failed independence plots by various opposing groups, Santo Domingo's former Lieutenant-Governor (top administrator), José Núñez de Cáceres, declared the colony's independence from the Spanish crown as Spanish Haiti, on November 30, 1821. This period is also known as the Ephemeral independence.
Title: People of the Dominican Republic
Content:  Santo Domingo attained independence as the Dominican Republic in 1844. In 1861, the Dominicans voluntarily returned to the Spanish Empire, but two years later they launched a war that restored independence in 1865. A legacy of unsettled, mostly non-representative rule followed, capped by the dictatorship of Rafael Trujillo from 1930 to 1961. Trujillo's regime carried out killings of thousands of Haitians and committed crimes in  the United States, Cuba, Puerto Rico, Venezuela, Guatemala, Costa Rica, and Mexico. Raids on the national treasury enabled Trujillo to amass a net worth of 800 million dollars (5.3 billion dollars today). It has been estimated that Trujillo's tyrannical rule was responsible for the death of more than 50,000 Dominicans. The Dominican Civil War of 1965 was ended by a United States-led intervention, and was followed by the authoritarian rule of Joaquín Balaguer, the leader from 1966 to 1978. Since that time, the Dominican Republic has moved steadily toward representative democracy.
Title: Dominican Republic–Spain relations
Content:  Soon after being part of Spain, the colony of Santo Domingo felt ignored by Spain while it focused more on its colony of Cuba, and as a result, many in the colony wanted independence for Santo Domingo. On 9 November 1821 the Spanish colonial government of Santo Domingo was toppled by a rebel group led by José Núñez de Cáceres. The rebels managed to obtain independence for the colony from Spain in December 1821 and Santo Domingo became known as the Republic of Spanish Haiti. The new government soon introduced a petition for the union of Spanish Haiti with Gran Colombia, however, in February 1822, Haiti invaded and took control of the country. In February 1844, after the Dominican 
Title: History of the Dominican Republic
Content:  independence except for a short Spanish occupation from 1861 to 1865 and occupation by the United States from 1916 to 1924. During the 19th century, Dominicans were often at war, fighting the French, Haitians, Spanish, or amongst themselves, resulting in a society heavily influenced by caudillos, who ruled the country as if it were their personal kingdom. Between 1844 and 1914, the Dominican Republic had 53 presidents (of whom only 3 had completed their terms) and 19 constitutions. Most came to power through the barrel of a gun and left the same way. Around 1930, the Dominican Republic found itself under the control of the mulatto 
Title: 1840s
Content: February 27, 1844 – The Dominican Republic gains independence from Haiti. ; November 6, 1844 – The Dominican Republic drafts its first Constitution. 
Title: La Trinitaria (Dominican Republic)
Content:  work, and after many battles and much bloodshed, the Dominican Republic was born on February 27, 1844, claiming independence from Haiti with a declaration at the Puerta del Conde. The involvement of La Trinitaria is also seen in the early formation of the new republic. Yet for the most part the society's ideology, which was in sync with Duarte's, was not implemented, as Pedro Santana forcibly took the reins of the newly formed nation and exiled Duarte. As a result, Santana enacted re-colonization of the country by Spain, making it the only former colony of the Americas to do so.
Title: Dominican Republic–Haiti relations
Content:  On 27 February 1844 the Dominicans, led by Juan Pablo Duarte along with Francisco del Rosario Sánchez and Matías Ramón Mella, gained freedom from Haitian rule, thus giving birth to the Dominican Republic. After ousting the Haitian occupying force from the country, Dominican nationalists had to fight against a series of attempted invasions from 1844 to 1856. Haitian soldiers would make incessant attacks to try to regain control of the territory, but these efforts were to no avail as the Dominicans would go on to win every battle henceforth. Since then, Dominican–Haitian relations have been unstable.
Title: Decolonization of the Americas
Content:  independent Brazilian Empire. Spain would lose all three of its remaining Caribbean colonies by the end of the 1800s. Santo Domingo declared independence in 1821 as the Republic of Spanish Haiti. After unification and then split from the former French colony of Haiti, the President of the Dominican Republic signed an agreement that revert the country to a Spanish colony in 1861. This triggered the Dominican Restoration War, which resulted in the Dominican Republic's second independence from Spain in 1865. Cuba fought for independence from Spain in the Ten Years' War (1868–78) and Little War (1879-80) and finally the Cuban War of 
Title: Dominican Republic–Spain relations
Content:  of Independence, Santo Domingo regained its independence from Haiti. The new country soon amassed a great amount of debt and after seventeen years of independence, President Pedro Santana asked Spain to make Santo Domingo a Spanish colony again. Spain agreed and Santo Domingo returned as a colony in 1863. This action was supported by the cattlemen of the south while the northern elites opposed it. As soon as Spain regained the colony, a guerrilla war broke out known as the Dominican Restoration War where rebels fought against Spanish forces to regain independence from Spain. The rebels burned and looted property and raped and murdered Spaniards; the Spanish shot or hung those they suspected of being or helping the rebels. 

Question: who did the dominican republic gain its independence from?
Answer: Haiti.