Brazilian War of Independence
The Brazilian War of Independence (), was waged between the newly independent Brazilian Empire and the United Kingdom of Portugal, Brazil and the Algarves, which had just undergone the Liberal Revolution of 1820. It lasted from February 1822, when the first skirmishes took place, to March 1824, with the surrender of the Portuguese garrison in Montevideo. The war was fought on land and sea and involved both regular forces and civilian militia. Land and naval battles took place in the territories of Bahia, Cisplatina and Rio de Janeiro provinces, the vice-kingdom of Grão-Pará, and in Maranhão and Pernambuco, which today are part of Ceará, Piauí and Rio Grande do Norte states. There is a shortage of reliable casualty data. Casualty estimates are based on contemporary reports of battles and historical data, and range between a total of 5,700 to 6,200. Opposing forces 

The population of Colonial Brazil at the turn of the 19th century was 3.4 million. 60% of them were free men, mostly of Portuguese descent. It is difficult to say how many Reinóis (those born in Portugal) lived in Brazil in 1822, since all inhabitants were subjects of Portugal. The majority of the population lived near the Atlantic Ocean, mainly in the provinces of Pernambuco, Bahia and Minas Gerais. These three regions dominated economic and political life of the colony. The Pernambuco region thrived by producing sugar, a crop of great value at the time. The southern Bahia region produced sugar, cotton, tobacco and molasses. It was the most densely populated and richest region. Further south was Rio de Janeiro, which controlled the gold and diamond production of Minas Gerais. The Portuguese army in Brazil consisted of professional troops and militiamen. All officers were appointed by the Court of Lisbon. In 1817, a Republican revolt broke out in Pernambuco. As a result, 2,000 soldiers of the "Auxiliary Division" were sent to Brazil. With the arrival of the troops, native officers in Brazil were not given many responsibilities. At the start of the war, there were about 10,000 Portuguese soldiers and units of the royal cavalry along the Atlantic coast. About 3,000 soldiers were later besieged in Montevideo. A similar number of soldiers occupied Salvador and the rest of the troops were scattered throughout Brazil. History

Start of the war 
During late 1821 and early 1822, the inhabitants of Brazil took sides in the political upheavals that took place in Rio de Janeiro and Lisbon. Fights between Portuguese soldiers and local militias broke out in the streets of the main cities in 1822 and quickly spread inland, despite the arrival of reinforcements from Portugal. There was a split in the Luso-Brazilian Army which was garrisoned in the Cisplatina province (modern-day Uruguay). Portuguese regiments retreated to Montevideo and were surrounded by Brazilians, led by Baron of Laguna (himself a Portuguese, but, as many other aristocrats, on the side of Brazilian independence). The remote and sparsely populated northern provinces of Pará and Maranhão declared loyalty to Portugal. Pernambuco was in favor of independence, but in Bahia there was no consensus among the population. While Portuguese forces were able to stop the local militias in certain cities, including Salvador, Montevideo and São Luís, they failed to defeat the militias in most of the other cities and proved ineffective against the guerrilla forces in the rural areas of the country. Supporters of Brazilian Independence created and enlarged the Brazilian Army and the Brazilian Navy by forced enlistment of citizens, foreign immigrants and mercenaries. They enlisted Brazilian slaves into militias and also freed slaves in order to enlist them in the army and the navy. By 1823, the Brazilian Army had grown, replacing its early losses in terms of both personnel and supplies. The remaining Portuguese forces, already on the defensive, were rapidly running out of both manpower and supplies. Outnumbered across a vast territory, the Portuguese were forced to restrict their sphere of action to the provincial capitals along the shore that represented the country's strategic sea ports, including Belém, Montevideo, Salvador and São Luís do Maranhão. Naval action 
Both parties (Portuguese and Brazilian) saw the Portuguese warships spread across the country (mostly in poor condition) as the instrument through which military victory could be achieved. In early 1822, the Portuguese navy controlled a ship of the line, two frigates, four corvettes, two brigs, and four warships of other categories in Brazilian waters. Warships available immediately for the new Brazilian navy were numerous, but in disrepair. The hulls of several ships that were brought by the Royal Family and the Court to be abandoned in Brazil were rotten and therefore of little value. Some underwent repairs and saw action in the war, however, such as the Pedro I ship of the line. The Brazilian agent in London, Felisberto Caldeira Brant, the Marquis of Barbacena, received orders to acquire warships fully equipped and manned on credit. No vendor, however, was willing to take the risks. Finally, there was an initial public offering, and the new Emperor personally signed for 350 of them, inspiring others to do the same. Thus, the new government was successful in raising funds to purchase a fleet. Arranging crews was another problem. A significant number of former officers and Portuguese sailors volunteered to serve the new nation, and swore loyalty to it. Their loyalty, however, was under suspicion. For this reason, British officers and men were recruited to fill out the ranks and end the dependence on the Portuguese. The Brazilian Navy was led by British officer Thomas Cochrane. The newly renovated navy experienced a number of early setbacks due to sabotage by Portuguese-born men in the naval crews. But by 1823 the navy had been reformed and the Portuguese members were replaced by native Brazilians, freed slaves, pardoned prisoners as well as more experienced British and American mercenaries. The navy succeeded in clearing the coast of the Portuguese presence and isolating the remaining Portuguese land troops. By the end of 1823, the Brazilian naval forces had pursued the remaining Portuguese ships across the Atlantic nearly as far as the shores of Portugal. Key battles 

Pernambuco
Siege of Recife

Piauí and Maranhão
Battle of Jenipapo
Siege of Caxias

Grand Pará
 Siege of Belém

Bahia
Battle of Cachoeira
Battle of Pirajá
Battle of Itaparica
Battle of May 4
Siege of Salvador

Cisplatina
Siege of Montevideo (1822–1824)

Peace treaty and aftermath 

The Portuguese military defeat was not followed by swift recognition of Brazil's independence. From 1822 to 1825 the Portuguese Government engaged in heavy diplomatic efforts to avoid the recognition of Brazil's independence by the European Powers, invoking the principles of the Congress of Vienna and subsequent European alliances. In 1824, in the wake of the adoption of the Constitution of the Empire of Brazil on March 25, the United States of America became the first nation to recognize the independence of Brazil. Since the coup d'etát on 3 June 1823 the Portuguese King John VI had already abolished the Constitution of 1822 and dissolved the Cortes, thus reversing the Liberal Revolution of 1820. Under British pressure, Portugal eventually agreed to recognize Brazil's independence in 1825, thus allowing the new country to establish diplomatic ties with other European powers. The first act of recognition was materialized in Letters Patent issued on May 13, 1825, by which the Portuguese King "voluntarily ceded and transferred the sovereignty" over Brazil to his son, the Brazilian Emperor, and thus recognized, as a result of this concession, Brazil as an "Independent Empire, separate from the Kingdoms of Portugal and Algarves". The second act of recognition was materialized in a Treaty of Peace signed in Rio de Janeiro on August 29, 1825, by means of which Portugal again recognized the independence of Brazil. This Treaty was ratified by the Emperor of Brazil on August 30, 1825, and by the King of Portugal on November 15, 1825, and entered into force in international Law also on November 15, 1825 upon the exchange of the instruments of ratification in Lisbon. The Portuguese, however, only agreed to sign the Independence treaty on condition that Brazil agreed to pay reparations for the properties of the Portuguese State that were seized by the new Brazilian State. Brazil desperately needed to establish normal diplomatic relations with Portugal, because other European Monarchies had already made clear that they would only recognize the Empire of Brazil after the establishment of normal relations between Brazil and Portugal. Thus, by a separate convention that was signed on the same occasion as the Treaty on the Recognition of Independence, Brazil agreed to pay Portugal two million pounds in damages. The British, who had mediated the Peace negotiations, granted Brazil a loan of the same value, so that Brazil could pay the agreed sum. In spite of the unpopular clauses, and especially of the harsh financial agreement, Brazilian Emperor Pedro I agreed to ratify the treaty negotiated with Portugal as he was keen on resolving the recognition of independence question before the opening of the first legislative session of the Brazilian Parliament (Assembléia Geral or General Assembly) elected under the Constitution adopted in 1824. The first meeting of the new Legislature was set to take place on 3 May 1826, and after a brief delay, that Parliament was indeed opened on 6 May 1826. By that time, the independence question was resolved, as the Independence treaty had been ratified in November 1825 and as the Emperor, still yielding the fullness of legislative authority (that he was to lose upon the first meeting of the Parliament), ordered the execution of the agreement as part of the law of Brazil on 10 April 1826. With the loss of its only territory in the Americas and a significant portion of its income, Portugal quickly turned its attention to increasing the commercial productivity of its various African possessions (mainly Angola and Mozambique). See also

 Age of Revolution
 Latin American wars of independence
 Spanish American wars of independence
 List of rebellions and revolutions in Brazil

References 

Latin American wars of independence
Wars of independence
Independence
Wars involving Portugal