AMMAN, Jordan (AP) _ Iraq closed its borders for five days and invalidated pre-Gulf War 25-dinar banknotes today in a bid to stop the collapse of its currency under U.N. economic sanctions.

Saddam Hussein's ruling Revolutionary Command Council announced the moves in Baghdad two days after imposing tough taxes on Iraqis traveling abroad.

Much of the dinar's deterioration has been due to the widespread smuggling of dinars worth billions of dollars out of Iraq.

The smuggling, as well as the need to finance postwar reconstruction and buy food abroad, has forced Saddam's government to print vast quantities of cash, further undermining the value of the dinar.

The official Iraq News Agency, monitored in Amman, said the command council ordered all border crossings closed until midnight Sunday to ''ensure an effective implementation of the new currency law.'' Official delegations, Arab and non-Arab, and Iraqi government envoys were exempted from the travel ban.

The agency did not say why the 25-dinar banknotes were being withdrawn. But it said Iraqis had one week to exchange them for new 25-dinar bills at Iraqi banks. Iraq's Central Bank later said all the old notes would be worthless as of Monday.

Hundreds of people jammed foreign exchanges houses in downtown Amman clamoring to sell dinars, but dealers refused and many shut down for the day.

The value of the dinar has fallen steadily since February, when it was pegged at around 23 to the dollar on the black market - compared to the official rate of 0.32 dinars to the dollar. The dinar hit an all-time low of 120 to the dollar Monday but swung back to around 65 on Tuesday.

A major factor in the dinar's wild fluctations in recent weeks has been the lack of any indication that the U.N. Security Council will relax or lift the sanctions in the immediate future.

The council imposed a ban on all trade with Iraq, except for food and medicine, after Saddam sent his army into Kuwait in August 1990.

Iraq's economy has been largely at a standstill since and hardships are worsening for the country's 18 million people.

Last week, Iraqi and Jordanian businessmen told The Associated Press that Saddam was moving gold into Jordan to convert into foreign currency because Baghdad's hard currency reserves had virtually run out.

With Iraq's oil exports blocked, Saddam has been dipping into Iraq's gold reserves - unofficially estimated at $5 billion in January 1992 - for the last year, mainly to pay for food imports. Last year, for instance, Baghdad paid Australia in gold for 1 million tons of wheat.