The Japanese government says it is undeterred in its fight against terrorism, following the killing of a Japanese hostage in Iraq.
Koda is the first Japanese national to be killed by hostage-takers
The Japanese foreign minister said Japan would neither yield to terrorism nor withdraw its troops from Iraq.
Nobutaka Machimura confirmed that a body found in Baghdad was that of the missing Japanese man, Shosei Koda.
An Islamist group led by Abu Musab al-Zarqawi had threatened to behead him if the Japanese troops were not withdrawn.
Prime Minister Junichiro Koizumi condemned the killing as a "cruel and inhuman act" and said Japan would "resolutely fight against terrorism".
The troops would stay in Iraq "for the sake of the people of Iraq and continue resolutely to fight against terrorism", Mr Koizumi said, according to French news agency AFP.
Japanese troops are in Iraq in a non-combat role.
They are supposed to be undertaking humanitarian work but are said to be mostly confined to their camp because of security fears.
Tokyo has repeatedly refused demands to pull its 550 troops out of Samawa, southern Iraq.
Their deployment is unpopular with many people in Japan, who see it as a breach of the country's constitution.
Correspondents say the beheading could badly affect Mr Koizumi, but some add that many in Japan feel Mr Koda ignored firm government advice to stay away from Iraq.
Mr Koda, a 24-year-old from Naogata in Japan's Fukuoka prefecture, left on a year-long trip in January, starting in New Zealand.
He told people he met on the way that he wanted to go to Iraq out of curiosity.
Officials said he took a bus to Baghdad from Amman in Jordan and was seen up until last Sunday attempting in vain to find accommodation in the city.
Earlier this year, Japan managed to free five other citizens taken hostage in Iraq after days of mediation.