The Algerian Foreign Ministry identified the victims as Ali Belaroussi, the charge d'affaires, who has been in Iraq for
nearly two years, and Azzedin Belkadi, who arrived in Baghdad less than a month ago.
A third Algerian diplomat in Baghdad, Abdel Wahab Fellah, said he witnessed the capture as he drove down the street leading to his embassy.
"I was on the other side of the main road when I saw people in two cars pull them out of their land cruiser and take them," he said.
"They must have been waiting for them," he added. "I couldn't do anything. I just called the police."
Police sources said armed men in two cars snatched the two diplomats off the street outside a restaurant.
An employee at the embassy reached by telephone confirmed the capture of the two.
The incident occurred in the Al-Mansur district of west
Baghdad at 14.10pm (1010 GMT). The two diplomats were bundled separately into the trunks of the captors' cars, an Interior Ministry official said.
The cars had number plates from Al-Anbar province, the official added.
Earlier this month, armed men ambushed three other top diplomats from Muslim countries in western Baghdad, all in an apparent bid to scare off foreign governments and isolate Iraq from the Arab world.
"I was on the other side of the main road when I saw people in two cars pull the men out of their land cruiser and take them"
Abdel Wahab Fellah,
Algerian diplomat eyewitness
The group linked to al-Qaida in Iraq led by Abu Musab al-Zarqawi claimed to have killed one, the Egyptian top envoy Ihab al-Sherif. Bahrain's top envoy to Iraq was slightly wounded, and Pakistan's ambassador escaped injury in an attack.
A total of 49 countries or entities have some form of diplomatic representation in Iraq, including 18 Arab or non-Arab Muslim countries, according to Iraq's Foreign Ministry and country websites.