Capoeira began in the 16th century in Brazil, devised by African slaves, mainly from Angola, brought to Brazil by Portuguese colonists.

The main trade in Brazil under the Portuguese was sugarcane production and processing, which depended on the labor of slaves. These slaves were often kept in inhumane conditions and forced to work hard and often suffered physical punishment for small misbehaviors.

Although slaves often outnumbered colonists, rebellions were rare because the lack of weapons, harsh colonial law, disagreement between slaves coming from different African cultures and lack of knowledge about the new land and its surroundings, all of which usually discouraged the idea of a rebellion.

In this environment, capoeira was born as a simple method of survival. It was a tool with which an escaped slave, completely unequipped, could survive in the hostile, unknown land and face the hunt of the capitães-do-mato, the armed and mounted colonial agents who were charged with finding and capturing escapees.

Soon several groups of escaping slaves would gather and establish quilombos, primitive settlements in far and hard to reach places. Some quilombos would grow to an enormous size, becoming independent multi-ethnic states.

Everyday life in a quilombo offered freedom and the opportunity to revive traditional cultures away from colonial oppression. In this kind of multi-ethnic community, constantly threatened by Portuguese colonial troops, capoeira evolved from a survival tool to a martial art focused on war. The biggest quilombo, the Quilombo dos Palmares, consisted of many villages which lasted more than a century, resisting at least 24 small attacks and 18 colonial invasions.

In 1808, the prince and future king Dom João VI, along with the Portuguese court, escaped to Brazil from the invasion of Portugal by Napoleon's troops. Formerly exploited only for its natural resources and commodity crops, the colony finally began to develop as a nation. The Portuguese monopoly effectively came to an end when Brazilian ports opened for trade with friendly foreign nations. Those cities grew in importance and Brazilians got permission to manufacture common products once required to be imported from Portugal, such as glass.

Registries of capoeira practices existed since the 18th century in Rio de Janeiro, Salvador and Recife. Due to city growth, more slaves were brought to cities and the increase in social life in the cities made capoeira more prominent and allowed it to be taught and practiced among more people. Because capoeira was often used against the colonial guard, in Rio the colonial government tried to suppress it and established severe physical punishments to its practice. In fact, many slaves were even arrested for practicing capoeira.By the end of the 19th century, slavery was on decline in Brazil and in 1888, Brazil passed a law to end slavery called Lei Áurea (Golden Law), sanctioned by imperial parliament and signed by Princess Isabel.

However, free slaves now had nowhere to live, no jobs and were despised by Brazilian society, which usually viewed them as lazy workers. Soon capoeiristas started to use their skills in unconventional ways. Criminals and war lords used capoeiristas as body guards and hitmen. And in 1890, the recently proclaimed Brazilian Republic banned capoeira in the whole country. After the ban, anybody caught practicing capoeira – in a fight or for any other reason – would be arrested and often tortured by the police. Cultural practices, such as the roda de capoeira, were conducted in remote places with sentries to warn of approaching police.

By the 1920s, capoeira repression had declined. Mestre Bimba from Salvador, a strong fighter in both legal and illegal fights, met with his future student, Cisnando Lima. Both thought capoeira was losing its martial roots due to the use of its playful side to entertain tourists. Mestre Bimba began developing the first systematic training method for capoeira, and in 1932 founded the first capoeira school. Advised by Cisnando, Mestre Bimba called his style Luta Regional Baiana because capoeira was still illegal in name.In 1937, Mestre Bimba founded the school Centro de Cultura Física e Luta Regional, with permission from Salvador's Secretary of Education. His work was very well received, and he taught capoeira to the cultural elite of the city. By 1940, capoeira finally lost its criminal connotation and was legalized.

Mestre Bimba's Regional style overshadowed traditional capoeiristas, who were still distrusted by society. This began to change in 1941 with the founding of Centro Esportivo de Capoeira Angola (CECA) by Mestre Pastinha. Located in the Salvador neighborhood of Pelourinho, this school attracted many traditional capoeiristas. With CECA's prominence, the traditional style came to be called Capoeira Angola. The name derived from brincar de angola ("playing Angola"), a term used in the 19th century in some places. But it was also adopted by other masters, including some who did not follow Mestre Pastinha's style.

Capoeira nowadays is not only a martial art, but a complete fitness and performance art. After Grande Mestre Suassuna established Cordão de Ouro academy, capoeira mestres began to emigrate and teach it in other countries.

In 2014, the UNESCO granted a special protected status to capoeira as an "intangible cultural heritage", making capoeira the only martial art form to be such recognised.