US President Barack Obama kisses hello Brazil's President Dilma Rousseff as they arrive for a photo during the G20 summit in Saint Petersburg.

LIMA, Peru — The United States' relationship with Brazil is on the rocks after more National Security Agency revelations, this time that Washington spied on President Dilma Rousseff and her nation's oil company, Petrobras.

She is so furious that she has threatened to cancel her trip to the US next month — the only full state visit scheduled at the White House this year and the first by a Brazilian head-of-state in nearly two decades.

Read more: Brazil's NSA fury

Washington’s relations with Brasilia, which have been cordial but cool in recent years, could hardly be more important. After the US, Brazil is both the Western Hemisphere’s second largest economy and second most populous nation.

Brazil also has many shared interests with the US. But despite polite public diplomacy, there have been plenty of ups and downs:

Iraq war
Perhaps the biggest blip in US-Brazilian relations in recent memory was the second Iraq war. Like much of the world, Brazil was a strong critic of George W. Bush’s logic for invading Iraq, which first erroneously linked Saddam Hussein to 9/11 and then claimed, just as disastrously, that the dictator had weapons of mass destruction. “A war can perhaps be won single-handedly, but peace, lasting peace, cannot be secured without the support of all,” Rousseff’s predecessor, President Luiz Inacio Lula da Silva, known as Lula, once said about the US-led occupation of Iraq. The Middle East continues to be a source of division; Brazil’s 2010 attempt to broker a deal with Iran to slash its nuclear reserves was frowned on within the Washington. Brazil was also one of the G20 nations that this week refused to back Obama’s call for action over Syria.

No Latin American nation has been a bigger thorn in America's side in recent years than Venezuela. For years, President Hugo Chavez railed against US “imperialism,” and now his successor, Nicolas Maduro, continues to do the same. Despite Chavez's often outlandish statements, former Brazilian president Lula and Chavez were close allies, often exchanging showy, public bear hugs in case anyone doubted their friendship. The Brasilia-Caracas relationship has cooled, yet Rousseff remains an ally of Maduro.

US cotton subsidies
Despite both favoring “free trade,” Brazil and Washington have been unable to reach agreement on various issues in global negotiations to bring down tariffs and other barriers to international commerce. The deepest rift is over US subsidies for its cotton industry, which Brazil says tilts the playing field against its farmers. Brazil actually took its case against the US to a World Trade Organization tribunal and won, giving it the right to launch retaliatory measures against US imports. The two countries patched up their differences temporarily, but Brazil is still waiting for a permanent solution.

After the US, Brazil is the world’s second largest destination market for cocaine and other coca-derived narcotics. Bolivia’s jungle border with Brazil, through which much of the drugs pass, is actually longer than America's border with Mexico and, like Washington, Brasilia has ramped up security along the frontier, with helicopters, drones and heavily armed ground patrols. Although Brazil has yet to join the calls of some other Latin American nations for an end to the US-backed “war on drugs,” its policies in the Andes do have a different emphasis than those of the US. That includes backing Bolivia’s attempts to have coca farmers voluntarily switch to other crops, while US policy is for forced eradication, by either fumigation or sending in the police and army to burn coca plants.

More from GlobalPost: Can Bolivia teach the US how to fight drugs?

Media freedom
Unlike some Latin American nations, Brazil has a strong recent record on media freedom. Yet there was one notorious exception to that rule, which did cause friction with the US — in 2004, when New York Times correspondent Larry Rohter accused former President Lula of being a drunk. Brazil revoked his visa, and then relented after receiving an “apology” from the reporter. Whether Rohter’s reporting was accurate or not, threatening to boot him out of the country was hardly the behavior fitting of a democracy that advocates the kind of media freedom championed by the US.

Growing international influence
Brazil is also seeking a greater role on the international stage, in keeping with its status as one of the world’s biggest economies and most populous democracies. In particular, it has been campaigning for a permanent seat on the United Nations Security Council. Currently, there are just five nations with that status, the principal victors of WWII: China, France, Russia, the US and UK. In the face of frequent intransigence from Beijing and Moscow, you might think that the US would publicly welcome to the panel another democratic power with many shared values. So far, though, that welcome has not been forthcoming.

Related Stories