China says the current visit to Beijing by Japan's Prime Minister Shinzo Abe - the first such contact for five years - marks a turning-point in relations.
Mr Abe has not said in public if he plans to visit the Yasukuni shrine
At a meeting in the capital, both sides said they hoped to overcome tensions that have hampered progress on trade, territorial and energy disputes.
The two nations also agreed that it would be "unacceptable" for North Korea to conduct a nuclear test, Mr Abe said
Chinese leaders accepted in principle an invitation to visit Japan.
Speaking after the meeting, Mr Abe told reporters that, "Japan and China shared the view that a North Korean nuclear test is unacceptable."
"This is a strong message to North Korea," he added.
He also called on Pyongyang to return unconditionally to negotiations over its nuclear programme.
China's president, Hu Jinto, declared the visit a "positive" step while China's prime minister went further by promising friendly, co-operative relations.
In what correspondents say is a sign of the importance Tokyo attaches to the trip, Mr Abe has broken with the tradition of new Japanese prime ministers making their first foreign visit to Washington.
Both China and South Korea's leaders had previously refused to meet Japan's last prime minister Junichiro Koizumi over his visits to a controversial shrine.
However, his successor was given a full ceremonial welcome in the Chinese capital.
Renewed Sino-Japanese ties are also seen as key to addressing North Korea's threat to test a nuclear weapon.
Japan has warned that it will seek tough action from the United Nations if North Korea carries out the test.
Mr Abe is due to fly to Seoul on Monday for talks with South Korean President Roh Moo-hyun.
Mr Abe's visit marks a thawing in relations. Both China and South Korea's leaders refused to meet Mr Koizumi over his decision to visit the Yasukuni shrine, which honours Japan's war dead, including 14 World War II war criminals.
Both China and South Korea say the shrine glorifies Japan's past militarism, particularly during World War II.
Mr Koizumi made six visits to the shrine while he was prime minister, despite protests from Japan's regional neighbours.
The last bilateral summit between Japan and China took place in October 2001, when Mr Koizumi visited Beijing.
The last meeting between the two countries' leaders came in April 2005, on the fringes of an Asia-African summit in Indonesia.
Since his recent election victory Mr Abe has so far refused to comment on whether he plans to visit the shrine.
But his election has brought the hope of a regional rapprochement.
But the BBC's East Asia regional analyst Clare Harkey says that neither the appointment of Mr Abe nor the summit talks mean that the issues dividing China and Japan will simply disappear.
At the heart of the disagreements between the two countries, our correspondent says, is a real struggle for regional dominance.
Despite being each other's largest trading partners, they disagree and compete on a range of issues, including United Nations reform and access to resources like oil and gas.
Japan is worried about China's military modernisation, China is concerned by Japan's increasingly close military links with the United States, our correspondent adds.