The surplus is 68.2 percent higher compared to the first half of 2020, when it totaled 22.3 billion U.S. dollars.
Exports in the first six months of the year grew by 35.8 percent to reach 136.7 billion U.S. dollars, while imports increased by 26.5 percent to reach 99.2 billion U.S. dollars.
In June, the trade surplus amounted to 10.3 billion U.S. dollars, a record high for that month.
Exports totaled 28.1 billion U.S. dollars last month while imports reached 17.7 billion U.S. dollars, marking a 60.8 percent increase in exports and a 61.5 percent rise in imports compared to the same month of 2020.
According to the undersecretary of Foreign Trade Intelligence and Statistics, Herlon Brandao, it is the first time Brazil registers a trade surplus of more than 10 billion U.S. dollars in a month.
"The trade balance is a record for the month of June and for any month of the year," he said.
Brazil's exports were driven mainly by the sale of raw materials and basic goods such as iron ore, oil and soybeans.
Brandao explained that these products have been influenced by the increase in international prices, but also by the growth of export volumes.
In terms of imports, the leading products were intermediate goods such as chemical products, electrical and electronic inputs, and fertilizers.