STOCKHOLM, JUNE 17 -- Businesses or governments in at least 26 countries have sold weapons to both sides in the Iran-Iraq war, which was rated as the bloodiest of 36 conflicts involving 5 million soldiers and 41 countries last year, the Stockholm International Peace Research Institute said in its annual report today.

Policy-makers are losing control of the arms trade to businessmen, and many of the sales took place without the knowledge or support of the governments named, the institute, an independent group funded mostly by the Swedish Parliament, said in its 500-page report.

Since the last survey of the Iran-Iraq war in 1985, 17 countries have joined the institute's list of those selling weapons to both sides, including Sweden, Britain, South Africa and the Netherlands. The United States and the Soviet Union were among those on the 1984 list.

Institute researcher Thomas Ohlson said the dramatic rise in the number of countries selling arms in the Persian Gulf could be traced in part to the disclosure of U.S. sales to Iran, which prompted other countries to relax their embargoes.

The institute listed the U.S. sale to Iran, a West German sale of submarine blueprints to South Africa and Sweden's sale of munitions to Middle Eastern countries as cases in which profits proved more persuasive than policy.

Real military spending fell in 40 percent of the 86 countries for which figures were available. U.S. allocations fell for the first time in 10 years, by 3.5 percent.

The report said China has emerged as a major arms exporter, controlling 4.3 percent of the Third World market.