TOKYO - The foreign ministers of Japan and China agreed Thursday that the two nations will maintain close communication "at all levels," the Japanese government said, as they have been exploring how to mend bilateral ties that often become tense.