THEY are the biggest and third-biggest countries by population in Latin America. They share a border of almost 2,000km (1,250 miles). But Colombia and Brazil get along badly. In 2009 mistrust burst into the open, when Brazil's then president, Luiz Inácio Lula da Silva, grumbled in public about an agreement negotiated by Colombia's Álvaro Uribe to update the terms under which American forces could use seven military bases for joint action against drug-trafficking and guerrillas.

Now there is a concerted effort to improve ties. On August 4th Lula led a group of Brazilian business moguls to Bogotá, invited by the Inter-American Development Bank (IDB) to discuss ways of boosting trade between the two countries. This has quadrupled since 2004, but at some $3 billion last year amounts to less than 1% of the two countries' total trade.

The Amazon basin is a huge barrier to commerce. There is no road between Colombia and Brazil. According to the IDB, it costs a Colombian exporter slightly more than a Canadian to ship goods to Brazil. The bank reckons that trade could double in five years with lower import tariffs, better customs procedures and improved transport links.

Political ties are warming, too. Lula's government disliked American military aid to Colombia. Colombian officials complained that Brazil showed little solidarity with their democracy's fight against the narco-guerrillas of the FARC. Brazil seemed tacitly to side with Venezuela's Hugo Chávez in his frequent clashes with Mr Uribe.

“There was much distrust,” between him and Mr Uribe, Lula admitted, adding that their successors, Dilma Rousseff and Juan Manuel Santos “can do much more”. Mr Santos has let the base agreement with the United States drop, and has made better relations with Brazil, Venezuela and South America a priority. One sign of that also came on August 4th when Nelson Jobim, Brazil's defence minister, signed a border-security agreement, which includes a provision for the “hot pursuit” of traffickers and guerrillas.

Sadly for Colombia, Mr Jobim was sacked that night by Ms Rousseff. The reasons were unrelated, but his replacement, Celso Amorim, was associated with the pro-Venezuelan policy as Lula's foreign minister. A friendship has begun, but it remains wary.