In 1856, China violated the Nanjing Treaty. In the treaty, the nation allowed the opening of five ports to England, these being of English domain. In that year, some Chinese officers boarded and searched the British-flagged ship Arrow, triggering yet another conflict between China and England.
But this time, the British had a new ally: France. Attacks by the two countries began in 1857. If England, which was already a power at the time and had ample capacity to win the war alone, with the help of the second largest power, France, the victory of the Europeans was obvious.
This time China was forced to sign another agreement: the Treaty of Tianjin, in which it guaranteed the opening of eleven new ports to the West, in addition to allowing freedom of movement for European merchants and missionaries Christians. To try to manage this large foreign flow, China then created the Ministry of Foreign Affairs, where it allowed itself to set up Western legations in the capital and renounced the term "barbarian", even used in documents when referring to the Westerners.
16th to 19th century - wars - Brazil School
Source: Brazil School - https://brasilescola.uol.com.br/guerras/segunda-guerra-opio.htm