Iraq has agreed to release all prisoners from the 1980-88 Iran-Iraq war and Iraq will release all Iranians in its jails, Iraq's Foreign Ministry said Thursday.

In an agreement signed Wednesday, the Foreign Ministry said, Iran would release 941 Iraqi prisoners of war later Thursday and Iraq would release 349 Iranian criminals in its jails on Monday and Tuesday. Iraq does not acknowledge holding Iranian prisoners of war.

The Foreign Ministry said the agreement was the result of a series of talks between the two nations. The Iraqi side was led by Abdul Munim al-Qaadi, head of the ministry's legal department, it said.

It was not clear whether the numbers given represented all prisoners held by the two sides, but the ministry said the order applied to all Iraqi prisoners of war and all Iranian prisoners in Iraqi jails.

The neighboring countries fought a bloody war over territory from 1980-88 in which about 1 million people were killed or wounded. Iran and Iraq have exchanged thousands of prisoners and remains of dead soldiers since the war ended with a U.N.-brokered cease-fire.

Nearly 14 years later, considerable enmity remains. Each country accuses the other of harboring rebels opposed to its government.

The problem of returning POWs has damaged relations between Iraq and Iran for years. Each state has accused the other of concealing how many prisoners it holds.

Since 1998, the International Committee of the Red Cross has been trying to repatriate all the remaining POWs, but the agency has said it does not know how many people were being held by both sides.

In January 2002, Iran released 697 Iraqi prisoners of war and, in return, Iraq handed over 50 Iranians detained for reasons not connected to the war.

Since the war ended, Tehran has returned the remains of 5,323 Iraqi soldiers, while Baghdad has returned 3,998 Iranian soldiers' remains, according to Iraq's Foreign Ministry.