Japan and China agreed Tuesday to work toward a trilateral summit with South Korea, despite political uncertainties roiling Seoul.

"With regard to the trilateral summit, we will continue coordination," Deputy Foreign Minister Takeo Akiba told reporters after his meetings with Chinese Foreign Minister Wang Yi and other senior diplomats in Beijing.

Akiba held discussions with Kong Xuanyou, China's assistant foreign minister, for more than three hours. They were in part aimed at creating a favorable environment for Premier Li Keqiang's possible first visit to Japan next month since taking office in 2013.

Akiba said he discussed with Kong almost all bilateral and regional concerns, including North Korea.

On top of an envisaged communication mechanism to avert accidental clashes in and above the East China Sea, he said much of their time was spent on how best to improve bilateral relations.

Akiba said he also met with Wang for about an hour. But he refused to elaborate on the two meetings.

Japan is seeking to host an annual trilateral summit involving the two countries and South Korea around Dec. 19 in Tokyo.

But the outlook of the summit being arranged by the end of this year has become increasingly uncertain, because of political turmoil in South Korea.

South Korean President Park Geun-hye, who has been hit hard by a corruption and influence-peddling scandal for a month, said Tuesday she is prepared to resign before her term ends if demanded by parliament and on condition that a smooth transition of power is ensured.

The two meetings took place a day after Akiba and Kong co-hosted a security dialogue involving diplomats and defense officials of the two countries for the first time since March 2015.