Prosecutor Kay Nehm said the raids were launched on Friday after police in southwest Germany intercepted a series of increasingly "hectic" telephone conversations pointing to an assassination attempt.
"There were indications related to a particular event in (Allawi's) programme," Nehm told a news conference, adding that a planned meeting with Iraqi exiles on Thursday evening had been cancelled because of the perceived threat.
"In further telephone conversations yesterday evening, the indications of attack plans strengthened," he said.
"Based on the changed programme and the reaction in the various telephone calls, one must conclude that the comments in those calls indicate something was planned against the Iraqi prime minister."
"Based on the changed programme and the reaction in the various telephone calls, one must conclude that the comments in those calls indicate something was planned against the Iraqi prime minister"
He added: "There was a certain hectic quality. It seems it wasn't a plan in preparation for a long time related to this visit, but more an ad-hoc decision to do something."
He declined to give further details before the suspects appear before a judge on Saturday.
Nehm's office had earlier said in a statement that in overnight raids on nine premises in Berlin, Augsburg and Stuttgart, three Iraqis, suspected to be members of the Ansar al-Islam group, were arrested.
Ansar al-Islam originated in Kurdish-held northern Iraq. The United States accuses it of working closely with al-Qaida and with the network of Abu Musab al-Zarqawi.
Al-Zarqawi's group threatened to assassinate Allawi in an internet statement in August.
The German arrests overshadowed Allawi's visit to Berlin, where he held talks with Chancellor Gerhard Schroeder. At a brief news conference, neither man referred to the raids.
Schroeder said Germany, which opposed the US-led war on Iraq and has ruled out sending troops there, was offering to provide bomb disposal training for Iraqi security forces.