BEIJING, March 12 (Reuters) - China extended a rare gesture of goodwill towards Japan on Wednesday, offering thanks - albeit indirectly - for an offer of help to look for a Malaysia Airlines aircraft which when missing on a flight to Beijing over the weekend.

China's ties with Japan have long been poisoned by what China sees as Japan's failure to atone for its occupation of parts of China before and during World War Two.

Beijing's anger over the past is never far from the surface, and relations have deteriorated sharply over the past 18 or so months because of a bitter dispute over a chain of uninhabited islands in the East China Sea.

Japan announced officially on Wednesday that it would send four military planes to help in the search for the missing Malaysia Airlines plane.

Chinese Foreign Ministry spokesman Qin Gang said he was aware of the news, though did not know if Japanese forces had already set off.

"I believe that in the face of such an incident, the international community, whether Malaysia, China or neighbouring countries, have a shared concern," Qin told a daily news briefing.

"If other countries can, and are willing, to send ships to participate in search work, we welcome it and express our thanks."

The massive search operation involving ships and aircraft from 10 countries is spread out over the Gulf of Thailand and the South China Sea, which lie between Malaysia and Vietnam, and in the Strait of Malacca extending into the Andaman Sea.

"There is an urgent need for help as soon as possible. So we hope to use the large amount of experience that the Japanese Self Defence Forces have in search operations to do everything we can to search for this plane," Japanese Defence Minister Itsunori Onodera said at a meeting to officially dispatch the planes to Malaysia.

Japan's Defence Ministry on Tuesday sent an advance team of four Self Defence Forces members to see what could to done to help in the investigation of fate of Flight MH370, which vanished on Saturday with 239 people on board.

Japan added it would send at least one C-130 transport on Wednesday and another three planes were scheduled to leave soon, including two P3C surveillance planes. (Reporting by Ben Blanchard; Additional reporting by Chris Meyers in TOKYO)