The State Department yesterday ordered the expulsion of all but four Iraqi diplomats from their embassy here, saying the action was taken "to reduce Iraq's ability to orchestrate terrorism" if war began in the Persian Gulf.

The department, in a statement yesterday, said it had called in Iraqi Ambassador Mohamed Mashat to tell him the diplomats and their families must be out of the country by midnight Tuesday, the deadline set by the U.N. Security Council for Iraq's withdrawal from Kuwait.

There are about 16 diplomats and staff members left in the embassy here, officials said. It was not known how many family members were in the country, an official said.

The department said, "The government of Iraq has repeatedly threatened to initiate terrorist attacks against the interests of the nations participating in Operation Desert Shield," the multinational force in Saudi Arabia arrayed against Iraq. The department added that the "primary objective" of the expulsion was to thwart terrorism.

Department officials said the United States, whose six remaining diplomats left Baghdad yesterday, was not breaking off diplomatic relations with Iraq. For that reason, the statement said, "we have permitted a small staff to remain in the United States to allow the embassy to function as a channel of communication."

The U.S. action follows a similar move by Britain, which on Jan. 3 expelled seven Iraqi diplomats and 68 others and cited the need to take precautions against terrorism. The State Department in August ordered the expulsion of 23 Iraqi diplomats and 66 dependents.

James P. Covey, acting assistant secretary of state for near eastern and south Asian affairs, handed Mashat a note at the State Department informing him of the order.

The department also announced that the four remaining Iraqis would not be allowed to travel beyond a 25-mile radius of the embassy. If the diplomats want to travel farther, they must obtain prior permission.

The announcement does not cover Iraqi diplomats working at the United Nations mission in New York. The United States does not have the authority to order the expulsion of Iraqi diplomats accredited there, although it can restrict their activities and travel, a department official said.