The United States condemned as "outrageous and offensive" comments by the mayor of the Japanese city of Osaka who said this week that Japan's military brothels during World War Two were "necessary" to provide respite for soldiers.

The remarks by Osaka Mayor Toru Hashimoto drew strong criticism from China and South Korea, two nations sensitive to what they see as any attempt to excuse Japanese abuses before and during the war.

Historians estimate that as many as 200,000 sex slaves, known as comfort women, were forced into submission in the Imperial Japanese Army's brothels during the war.

"Mayor Hashimoto's comments were outrageous and offensive," State Department spokeswoman Jen Psaki said on Thursday.

"What happened in that era to these women who were trafficked for sexual purposes is deplorable and clearly a grave human rights violation of enormous proportions," she said, adding that Washington hoped Japan would work with its neighbours to address the mistakes of the past.

'We feel great heartache'

The Japanese government has sought to distance itself from Hashimoto's comments.

"The government's stance is, as we have said before, that we feel great heartache when we think about the indescribable suffering of those who experienced this," Japan's chief cabinet secretary Yoshihide Suga said, although he declined to comment directly on Hashimoto's remarks.

The comments made on Monday raised anger in neighbouring countries that bore the brunt of Japan's wartime aggression, and that have long complained that Japan has failed to make amends for wartime atrocities.

In South Korea's capital Seoul, the foreign ministry expressed disappointment over what it called a senior Japanese official's serious lack of historical understanding and respect for women's rights.

China's foreign ministry criticised the mayor's comments and saw them as further evidence of a rightward drift in Japanese politics under prime minister Shinzo Abe.

"We are appalled and indignant about the Japanese politician's comments boldly challenging humanity and historical justice," Hong Lei, the ministry's spokesman, said at a daily media briefing earlier this week.