Brazil’s highest judicial authority has ordered Petrobras to refuel two Iranian grain ships after the Brazilian state-run oil company refused to assist the vessels citing the United States sanctions targeting the Islamic Republic.

On Thursday, Chief Justice Dias Toffoli overturned an injunction that had authorized the oil firm to withhold the service from Iranian vessels, Reuters reported.

The Iranian vessels have been stranded for weeks at the Brazilian port of Paranagua, unable to head back to Iran due to lack of fuel.

Brazilian President Jair Bolsonaro had said that local companies were warned about the extent of the US sanctions against the Islamic Republic.

"There is this problem; the US unilaterally imposed these sanctions on Iran. Brazilian companies have been informed by us about this situation and are running a risk there," Bolsonaro told reporters last Friday, while saying he was working to forge a very close relationship with the United States.

"I, particularly, am getting close to [US President Donald] Trump, I was received twice by him. It is the No. 1 economy in the world, our second-largest market, and now Brazil has its arms open to do deals and partnerships."

On Wednesday, Iran asked Brazil to allow refueling of Iranian ships or have Tehran cancel imports worth about $2 billion a year from the Latin American country.

On Tuesday, Iran’s Ambassador in Brasilia Seyed Ali Saghaeyan told Brazilian officials that Tehran could easily find new suppliers of corn, soybeans and meat if the South American country refused to permit the refueling of the vessels.

“I told the Brazilians that they should solve the issue, not the Iranians,” Saghaeyan said in an interview at the Iranian Embassy in Brasilia.

“If it’s not solved, maybe the authorities in Tehran may want to take some decision because this is a free market and other countries are available,” he added.

Trump brought back the sanctions against Iran last year after leaving a multilateral nuclear agreement between Iran and world powers. This is while the accord, officially known as the Joint Comprehensive Plan of Action (JCPOA), has been ratified in the form of a United Nations Security Council resolution.

Iran is one of the largest grain importers from Brazil and the complication with the Iranian ships is already worrying Brazilian traders about the broader impact on trade with the Islamic Republic.

Tehran has asked Brasilia to allow refueling of the vessels or have Tehran cancel imports worth about $2 billion a year from the Latin American country.