Shinzo Abe came to China in a bid to create a new start in bilateral relations, which have suffered in recent years over issues of Japan's past occupation of China, territorial disputes and a growing strategic rivalry between the two Asian giants.
This was the first summit of the two countries' leaders in five years.
Helping break the ice is North Korea's announcement that it plans to test a nuclear device - a development that has alarmed both Beijing and Tokyo and prodded them to start talking.
After meeting with President Hu Jintao, Premier Wen Jiabao and other top Chinese officials on Sunday, the Japanese leader told reporters the two sides have agreed they need to work together to stop North Korea from developing nuclear weapons.
The Japanese leader said he and his Chinese counterparts agreed that North Korea's announcement of a nuclear test - in his words - "cannot be tolerated" because, he said, it is a great threat to East Asia and to the international community.
Abe said he and Chinese leaders agreed North Korea should return to six nation negotiations, hosted by China, that also include South Korea, the United States, and Russia.
The Japanese leader said Sunday's summit should serve as a message to North Korea, and he said he assumes the North Koreans were watching closely. He also suggested China use the influence it has - as the North's closest ally - to draw Pyongyang back to negotiations.
The United States has warned North Korea against carrying out a test, saying it would be a provocative action and a threat to peace and stability in the region.
Last week, the U.N. Security Council threatened North Korea with unspecified consequences, if it goes ahead with a nuclear weapons test.
In his welcoming remarks to the Japanese leader Sunday, Chinese President Hu Jintao said the summit represents a positive turn in the two countries' relationship. Mr. Abe hopes to do similar fence-mending Monday in South Korea, where he will continue efforts to build consensus on how to deal with North Korea.