TOKYO, AUG. 5 -- With a firm push from his new friend President Bush, Prime Minister Toshiki Kaifu tonight ordered an immediate ban on Japanese oil imports from Iraq and Kuwait and a halt to all other commercial relations with Iraq.

Kaifu's action means that Iraqi President Saddam Hussein has lost his nation's three biggest oil customers -- the United States, Japan and the European Community. The cutoff may put something of a damper on Japan's supercharged economy, but this country is far better equipped to take the blow than it was at the time of the sudden petroleum price rises of the 1970s.

Still, the decision came in an atmosphere of real crisis here. Lights burned late into the night in government ministry buildings. The driveway to the Foreign Ministry was jammed with delivery motorcyles from Pizza-La, bringing midnight snacks to diplomats and economists who planned to work through the night.

{The Tokyo stock exchange fell by 3.1 percent in light trading Monday. The Nikkei stock average closed down 916.23 points at 28,599.53. The dollar rose marginally and in late morning was up 0.88 yen from Friday's close of 149.35 yen, the Associated Press reported.}

Middle East oil is the primary fuel sustaining Japan's current economic boom, and about 12 percent of the country's oil comes from Iraq and Kuwait. In addition, Iraq owes debts totaling about $5 billion to Japanese manufacturing companies, banks, and government agencies -- money that presumably will not be repaid while the import ban holds.

For these reasons, according to reports in the Japanese dailies, there were forceful arguments within Kaifu's cabinet against the ban on Iraqi oil. All weekend long, as other countries announced they would no longer buy from Saddam, Japan equivocated. Late Saturday, the Foreign Ministry firmly declared that Japan would make no decision on imports from Iraq until the United Nations passed a resolution demanding an embargo.

Meanwhile, though, Japan was feeling the heat from its allies and trading partners. Bush called Kaifu Friday night, Washington time, saying that he expected Japan to go along with a "concerted effort" to retaliate against Iraq for the invasion of Kuwait. About 100 members of Congress delivered a letter to the Japanese Embassy in Washington calling for an embargo on Iraqi oil.

Kaifu is riding a strong wave of popularity here, partly because of the perception that he and Bush have become personal friends in recent months. Accordingly, when Kaifu reached his decision to ban Iraqi oil imports tonight -- 7 a.m. Washington time -- he immediately called Bush, reporting the decision to the Americans before he told the Japanese people.

As a domestic political matter, it would not be useful to Kaifu to appear to have given in to American pressure. Foreign Ministry officials briefing the Japanese press tonight, accordingly, said the decision was not forced on the government.

Senior diplomat Makoto Watanabe, an elegantly dressed, gray-haired figure who drew smoke through a long, slender cigarette holder as he patiently answered questions from reporters, said the concerns of Japan's allies "were of course a factor." But he added it would be a mistake to say the import ban was the result of foreign pressure.

Although Japan took longer than other developed countries to embargo Iraqi oil, the government reacted much faster in this case than it has during past difficulties with Middle Eastern oil suppliers.

When Iranian militants captured and held American hostages in 1979, Japan condemned the Iranian action but was extremely cautious about a boycott of Iranian oil. When the Arab nations imposed an oil boycott in 1973, the Japanese nearly sank under the weight of the "oil shock" -- and subsequently worked hard to build friendships with Middle Eastern oil suppliers.

One reason Japan can more readily afford to stop buying Iraqi oil now stems from that 1973 shock. It prompted both government and private firms to store oil, largely in underground tanks. The government says Japan currently has a 142-day supply of oil in these reserves, and that period presumably could be extended with conservation measures.

Japan also has developed new suppliers, so that no single source of oil has a dominant role. Still, imports from Iraq and Kuwait total 400,000 barrels of Japan's total daily imports of almost 4 million barrels. It will probably be possible for Japan to find other sources for that oil, but prices may go up.

Iraq is one of the relatively few countries with which Japan has a balance-of-trade deficit. According to the Japanese government, Japan imported $1.2 billion in goods, virtually all oil, from Iraq, while exporting less than half that dollar value, mostly in heavy machinery and chemicals.

The $5 billion in outstanding debt owed by Iraq has been troublesome for Japan because Iraq is behind in its payments. Last week, just before Iraq invaded Kuwait, an Iraqi delegation was in Tokyo to work out terms for paying off the debt. It reportedly was agreed that Iraq would pay at least part of the debt in the form of oil shipments. Now, of course, there is no way for that deal to work.

Japan also froze its aid payments to Iraq as part of its retaliatory package. Earlier in the weekend, Japan announced that it would freeze all Kuwaiti assets in the country to keep Iraq from looting Kuwaiti accounts here.