Two Iranian grain vessels that Brazilian state-run oil company Petrobras refused to refuel are returning home this week after the country’s Supreme Court overruled President Jair Bolsonaro on the issue.

The diplomatic dispute began last week when, on orders from the Brazilian government, Petrobas refused to refuel two Iranian ships loaded with corn in Port Paranaguá along the country’s East Coast, arguing that doing so would violate U.S. trade sanctions against the regime.

Petrobras CEO Roberto Castello Branco confirmed this weekend that he had complied with a Supreme Court ruling ordering the company to refuel the ships, overturning an injunction that allowed the company to withhold fuel, citing U.S. sanctions that forbid selling oil to Iran. Both ships have now begun their journey back to Iran.

The case was brought to the Supreme Court by the Brazilian company Eleva Quimica, which argued that neither they nor their product were covered by U.S. sanctions on Iran, reimposed by the Trump administration last year. This argument was accepted by Chief Justice Dias Toffoli, who also cited the economic risks of denying service.

The order came shortly after Iranian Ambassador Seyed Ali Saqqayian reportedly said Tehran may suspend all imports from Brazil if the situation was not resolved. Brazilian businesses export over $2 billion a year worth of goods to Iran, their largest buyer of corn and among their top buyers of soybeans and beef. Many feared significant damage to Brazil’s economy if Iran stopped buying completely.

As noted by state propaganda outlet PressTV, “Brasilia and Tehran have long enjoyed a good history of political and economic relations,” mainly under the left-wing governments of the past two decades who were sympathetic to the Iranian regime.

Conservative President Jair Bolsonaro has expressed interest in cutting ties to the rogue Islamic regime and has indicated that he may toughen his stance towards Iran to win favor with the United States, with whom he hopes to deepen Brazil’s diplomatic and trade ties.

Bolsonaro recently warned Brazilian oil companies they may face reprisal from Washington should they deal with Iranian oil interests in violation of U.S. sanctions, adding that Brazil was “aligned” with U.S. policy on the matter.

“I am getting very close to Trump, I was received twice by him. It is the number one economy in the world, our second-largest market, and now Brazil has its arms open to doing deals and partnerships,” he said this month. “But there are certain things where it isn’t necessary to converse. We are aligned with their policies. So we do what we have to.”

Follow Ben Kew on Facebook, Twitter at @ben_kew, or email him at bkew@breitbart.com.