SAO PAULO, BRAZIL -- Somewhere between Brazil and the Persian Gulf is a shipment of 900 tons of frozen chickens that almost certainly will never be delivered or paid for, a symbol of the end of a once close and profitable relationship.

Brazil's decision to adhere to the United Nations sanctions barring trade with Iraq may cause pain in Baghdad, but it also will hurt the already slumping agricultural and industrial complex centered here in Sao Paulo.

Brazil and Iraq had been major trading partners since the late 1970s. Brazil needed oil to run its industrial machine. Iraq needed food, technical support, appliances, automobiles and, perhaps most important, the "defensive" weapons made by Brazil's sophisticated arms industry.

Iraq valued the relationship so much that it was willing to drop its requirement that its oil be paid for only with hard currency, which is in short supply in Brazil, and some of the oil was traded for Brazilian goods in what amounted to a barter system.

As a result, Brazil imported up to 160,000 barrels of Iraqi oil a day, which it now is seeking to replace. In turn, Brazil became one of Iraq's largest suppliers. Some of the Iraqi troops taking up positions in occupied Kuwait are arriving in Brazilian-made armored vehicles.

Now the trade is under embargo, and the business ties are under scrutiny. According to economist Adroaldo Moura da Silva: "The relationship with Iraq was one mistake after another."

In the peak year of 1985, at the height of the Iran-Iraq war, Brazilian exports to Iraq reached a value of $630 million. Last year, Brazil sold goods worth $342 million to Iraq. The drop from 1985 came about because of a winding down of the Iran-Iraq war, culminating in a cease-fire in 1988. Iraq was buying less military hardware from Brazil.

Exports are expected to be even lower this year, perhaps dipping to $200 million, in part because Iraq stopped paying its bills, and exporters reluctantly began looking elsewhere.

The aerospace firm Avibras reports that Iraq owes about $40 million for missile launchers bought in 1987. Engesa, which supplied Iraq with Cascavel light tanks, holds due bills for $90 million. Both firms are now failing -- reputedly because of those debits.

By one authoritative count, Brazil stands to lose a quick $1.3 billion as a result of the trade cutoff -- in goods supplied but not paid for, in government-sponsored bank credits and guarantees and in equipment stranded in Iraq. By contrast, Iraqi assets in Brazil total only about $10 million.

Brazil imported about $1.2 billion in oil from Iraq last year, also relatively low given recent history. The oil imports peaked in 1980 at $3.8 billion. The decline resulted in part from Brazil's diversifying its sources and suppliers of oil and exploring use of alternative fuels, such as alcohol.

Two weeks before the Iraqi invasion of Kuwait, Foreign Minister Francisco Rezek described the business ties between Iraq and Brazil as a model relationship -- despite the millions of dollars that Iraq owed Brazilian firms. On learning of the invasion, he was initially cautious, calling it "unusual."

But the government of President Fernando Collor de Mello, after first looking as if it might waffle, came out strongly in favor of the U.N. sanctions. "Brazil has no reason to act unilaterally," Rezek said. "Our bilateral trade with Iraq is not enough for us to adopt an isolated position."

Brazil has been negotiating to secure the release of nearly 450 Brazilian citizens who were working in Iraq at the time of the invasion. Many were there on contracts, such as the employees of the construction firm Mendes Junior, who had been building a highway linking Iraq and Jordan.

Included are 24 Brazilian scientists who have been working with the Iraqi government on military projects. Their presence has embarrassed the government and led Collor to demand an explanation from Brazil's Arerospace Technical Center, which is sponsoring the work.

It is unclear what projects the scientists are working on, but the aerospace center has denied published reports that they are trying to complete the joint development of an air-to-air missile called the Piranha. They are not among several dozen Brazilian nationals who have been allowed to leave Iraq in recent days.

Press reports here have criticized the government for statements that appeared to link the status of current food shipments to the release of Brazilian nationals -- in effect, a food-for-hostages negotiation, which the government denied.

A key factor that kept Brazilian-Iraqi ties strong in good years and bad was Baghdad's willingness to keep up a steady supply of oil. Brazil is rich in most natural resources but has paltry reserves of oil. During the oil shocks of the 1970s and early 1980s, Iraq was a friend.

"While other suppliers were adding various requirements that raised the price of oil, Iraq always supplied Brazil regularly and even made shipments without having been paid for the last," economist Narciso Carvalho, a Bank of Brazil official, said recently.

The Iraq-Iran war proved a gold mine for Brazil's arms export industry, the fourth-largest in the world. In 1987, for example, Avibras sold Iraq rockets worth $322 million -- more in exports that year than any other private Brazilian firm.

The newspaper Jornal do Brasil alleged recently that the military government that ruled Brazil from 1964 to 1985 cooperated with Iraq in an attempt to develop nuclear weapons and provided Saddam with a small quantity of enriched uranium. When suggestions of such a link were first aired in 1981, the government issued a categorical denial.

A major task now for Brazil is replacing the 160,000 barrels of oil it imported daily from Iraq and the 30,000 that came from Kuwait. The aim is to avoid a further increase in fuel prices here, which rose 8.5 percent last month and threaten to derail Collor's plans for economic recovery.

Negotiations have been conducted with Iran and Venezuela to make up the shortfall, and officials of the government oil company Petrobras are talking of the need to further diversify Brazil's list of suppliers.

"I'll be much calmer when Brazil has many suppliers . . . none of them selling us more than 50,000 barrels a day," said Luis Octavio da Motta Veiga, president of Petrobras.