Tokyo however vowed it would keep its troops in the country on what it calls a reconstruction mission.
An armed group in Iraq had on Wednesday threatened to behead Shosei Koda, 24, within 48 hours if Japan did not withdraw its troops.
"Unfortunately, we have just confirmed that the body is that of Shosei Koda," Foreign Minister Nobutaka Machimura said on Sunday.
"The act of terrorism to take the life of a civilian is absolutely vicious and we must not tolerate such acts," Machimura said.
"Japan, cooperating with the international community, must continue to fight terrorism firmly."
The Japanese government later reiterated that its troops, numbering about 550, would stay on in Iraq for humanitarian purposes. The troops are based at Samawa, 270km south of Baghdad.
Koda's body was found near a hospital in Baghdad. A Japanese foreign ministry official declined to comment on reports that the body had been wrapped in a US flag.
Confusion had surrounded Koda's fate.
Japan's FM Nobutaka Machimura
announced troops are to remain
A beheaded body found in Iraq on Friday was initially thought to be that of Koda, but was later identified as an Iraqi man.
Another corpse described as Asian-looking also turned out not to be Koda's.
At least 25 foreigners from a dozen countries, including two women, are thought to be currently held by armed groups seeking to drive US-led forces and foreign workers out of Iraq.
Sri Lankan appeal
Meanwhile, relatives of a Sri Lankan lorry driver appealed on Sunday to his captors in Iraq to free him, saying he had been forced to work there by his Kuwaiti employer.
Dinesh Dharmendran Rajaratnam, 36, who was seized by the Islamic Army in Iraq on Thursday, had told his family three weeks ago that he was desperate to return home, a family member said.
"He wanted us to send a fax message to his employer saying that there was a very pressing need for him to return home immediately," his brother-in-law Pullaiya Suresh said. "He was not paid the salary that was promised."
The Sri Lankan captive's family
say he was forced to work in Iraq
Rajaratnam, a father of three children aged 10, 12 and 14, had gone to Kuwait last year in the hope of earning enough to provide a better education for his children, Suresh said.
"We have not had any information from the authorities here. All we know is only through the international media. We want to go to the Kuwaiti embassy tomorrow to get more information," he said.
The family said they had paid 68,000 rupees ($650) to secure the driver's job in Kuwait, and his wife and three children would be destitute unless the captors freed him.
Sri Lanka has no diplomatic mission in Iraq and four months ago discouraged its nationals from going there in search of employment.
Sri Lanka's Muslim Media Forum and the Muslim Leagues Youth Foundation appealed to Rajaratnam's abductors to free him on humanitarian grounds.
"In this holy month of Ramadan, we appeal to his captors to release our fellow Sri Lankan brother on humanitarian grounds," said Muslim Media Forum chief NM Amin.
"In this holy month of Ramadan, we appeal to his captors to release our fellow Sri Lankan brother on humanitarian grounds"
Muslim Media Forum chief
Foreign ministry officials said they were working with the Sri Lankan mission in Lebanon to secure the release of the first Sri Lankan hostage in Iraq.
Aljazeera quoted a statement from the group as saying: "The two hostages were abducted before driving their trucks into a US base in Iraq."
The Bangladesh government has appealed for the release of its captive, identified as 42-year-old Abu al-Qasim, saying the Muslim-majority nation is not involved in the ongoing strife in Iraq.
A Polish woman held hostage by a group in Iraq was shown in a video aired on Aljazeera on Saturday night, pleading for the withdrawal of Polish troops from the country and the release of women prisoners to save her life.
"My life is in great danger, and the only thing that will save me is a response to the Iraqis' demand for, first, the withdrawal of Polish military forces from Iraqi territory, and secondly, offering any possible help to release Iraqi women prisoners from various US prisons in Iraq," she said, according to an Arabic voiceover.
Teresa Borcz has made a second
plea for Polish troops to leave
The woman has been identified by Polish media as Teresa Borcz, 54, a native of Krakow married to an Iraqi and resident in Iraq for more than 30 years.
In a video also aired by Aljazeera on Thursday, a group calling itself the Al-Salafiya Abu Bakr al-Siddiq Brigades said it kidnapped Borcz and demanded the withdrawal of the 2500 Polish troops in Iraq, prompting an immediate refusal from Warsaw.
"For the second time I appeal for help from the Polish government, the Polish people," the captive said in Saturday's footage.
Polish Muslims called on Friday for the woman to be freed.
"We call on all forces in Iraq to help efforts to free the kidnapped Polish woman," said Jozef Konopacki, deputy president of the 5000-strong association of Polish Muslims.