TOKYO (AFP) - Japan said Thursday it was ending an air mission in Iraq, wrapping up a military deployment, which was historic for the pacifist nation but deeply unpopular among the public. Foreign Minister Masahiko Komura said Tokyo planned by the end of the year to bring back planes, which flew goods and personnel into Iraq in support of the United Nations and US-led coalition. The mission is Japan's last remaining military operation in Iraq after the country, which has been officially pacifist since defeat in World War II, ended a landmark ground deployment in 2006. "After continued consultations with Iraq, we have come to believe that the situation in Iraq has gradually improved and that we are gradually achieving the purpose" of the Japanese mission, Komura said. Some 210 Japanese troops and airplanes operating in Iraq are stationed in Kuwait. Domestic legislation allowing the mission expires in July next year. "Even after pulling out the Air Self-Defence Forces, Japan's position to support Iraq will never change," Komura said. Citing the seventh anniversary of the September 11 terrorist attacks, Japan said it would continue another controversial mission in the Indian Ocean, in which the naval forces give fuel for the US-led "war on terror" in Afghanistan. "Operations in Afghanistan are becoming more and more significant," said Defence Minister Yoshisama Hayashi. "The international community will be able to focus more on the fight against terrorism in Afghanistan" after withdrawing from Iraq, he said. Japan's opposition, which has been making gains, is staunchly against both missions in Iraq and the Indian Ocean. It briefly forced a halt to the Indian Ocean deployment last year, saying Japan should not be part of "American wars." Yukio Hatoyama, secretary general of the main opposition Democratic Party, said that Japan never should have been involved militarily in Iraq in the first place. "It was clear that dispatching the Self-Defence Forces to Iraq was unconstitutional," he told reporters. "The government should have decided on the withdrawal sooner. The decision came too late." Then prime minister Junichiro Koizumi sent troops to Iraq after the 2003 US-led invasion, marking the first time that Japan deployed armed forces to a country where fighting was underway since 1945. Koizumi and other members of his Liberal Democratic Party (LDP) argue that Japan must do more to ensure global security to win respect on the world stage. But the mission was deeply unpopular with the Japanese public. Koizumi ended the ground mission in 2006 when the relatively safe area where Japanese forces were on a reconstruction mission was handed over to Iraqi control. The United States said the decision was a sign of progress in Iraq. "Japan has played a significant role in Iraq and will continue to be a significant partner in the war on terrorism," White House spokesman Gordon Johndroe said. Meanwhile, the White House hailed Japan's decision to halt its air mission for Iraq as a sign of progress, amid US forecasts that the "coalition of the willing" behind the 2003 invasion can now safely melt away. "Japan is our close friend and strong ally and we appreciate the willingess of the Japanese people to contribute to Iraqi stabilization and reconstruction," spokesman Gordon Johndroe said in a statement. "Japan's Self Defense Forces have made important contributions to coalition efforts and Japan's sacrifices will not be forgotten," he said, stressing that Tokyo's shift was possible "as a result of the progress made in Iraq." Tokyo announced earlier that it planned to wrap up the mission " a military deployment, which was historic for the pacifist nation but deeply unpopular among the public " by the end of the year, citing improvements in Iraq. Japanese Foreign Minister Masahiko Komura said Japan would bring home planes that flew goods and personnel in Iraq in support of the United Nations and the US-led coalition following the March 2003 invasion to oust Saddam Hussein. "After continued consultations with Iraq, we have come to believe that the situation in Iraq has gradually improved and that we are gradually achieving the purpose" of the Japanese mission, Komura said. The announcement came after a senior US official said Tuesday on condition of anonymity that the "coalition of the willing" in Iraq would shrink to "a handful of countries in the course of the next 90 days or so." And in a speech Tuesday announcing modest US troop withdrawals over the coming months, US President George W. Bush noted that Australia had withdrawn its battle group, Poland was poised to redeploy, and added "many more coalition nations will be able to conclude their deployments to Iraq this year." As of mid-July, the coalition included roughly 21 countries not counting the United States. In late March 2003, the White House boasted of 49 countries being publicly committed to Saddam's removal. The size and strength of the coalition, which the Bush administration used to counter charges that the war lacked international backing, has always been a matter of some controversy and sometimes bitter back and forth. Then-defense secretary Donald Rumsfeld rankled France and Germany when he dismissed their opposition to the invasion as coming from "Old Europe" while praising the support of younger democracies such as Poland. The air support mission is Tokyo's last remaining military operation in Iraq after Japan, which has been officially pacifist since defeat in World War II, ended a landmark ground deployment in 2006. Some 210 Japanese troops and airplanes operating in Iraq are stationed in Kuwait. Domestic legislation allowing the mission expires in July next year. "Even after pulling out the Air Self-Defence Forces, Japan's position to support Iraq will never change," Komura said. But, citing the seventh anniversary of the September 11 terrorist attacks, the government said it will continue another controversial mission in the Indian Ocean, in which the naval forces give fuel for US- and NATO-led forces fighting the war in Afghanistan. "Operations in Afghanistan are becoming more and more significant," said Defence Minister Yoshisama Hayashi. "The international community will be able to focus more on the fight against terrorism in Afghanistan" after withdrawing from Iraq, he said. Japan's opposition, which has been making gains, is staunchly against both missions in Iraq and the Indian Ocean. It briefly forced a halt to the Indian Ocean deployment last year, saying Japan should not be part of "American wars."