The leaders of China and Japan have both said that a nuclear test by North Korea would be "unacceptable".
Shared alarm over N Korea's threat may be fuelling improved ties
The statement came after Japan's new Prime Minister Shinzo Abe met Chinese leaders in their capital Beijing - the first such contact in five years.
North Korea's threat last week to test a nuclear weapon may have given greater urgency to improved relations between the two countries, correspondents say.
Mr Abe is now in South Korea where the threat will again top the talks agenda.
Mr Abe will meet South Korean President Roh Moo-hyun later on Monday.
As with China, Japan's relations with South Korea had deteriorated under Mr Abe's predecessor Junichiro Koizumi over his decision to visit a controversial war shrine.
Speaking after his talks in Beijing, 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.
Some observers have warned that a nuclear test could come within days.
On Saturday, as tensions over North Korea's declared intention flared, South Korean troops fired warning shots at soldiers from the North across their shared border.
Mr Abe also called on Pyongyang to return unconditionally to negotiations over its nuclear programme.
North Korea has been boycotting the six-party talks - which involve the two Koreas, the USA, China, Russia and Japan - in protest at US sanctions against it.
China's President Hu Jintao declared the visit a "positive" step, while China's Prime Minister Wen Jiabao went further by promising friendly, co-operative relations.
KOREAN NUCLEAR CRISIS
Sept 2005:At first hailed as a breakthrough, North Korea agrees to give up nuclear activities
Next day, N Korea says it will not scrap its activities unless it gets a civilian nuclear reactor
US imposes financial sanctions on N Korea businesses
July 2006: N Korea test-fires seven missiles
UN Security Council votes to impose sanctions over the tests
Oct 2006: N Korea threatens nuclear test
Chinese leaders accepted in principle an invitation to visit Japan.
Just three weeks ago, such a joint statement condemning North Korea for its nuclear programme would have been almost unthinkable, says the BBC's correspondent in Beijing, Rupert Wingfield-Hayes.
It shows how alarmed Beijing is by the prospect of a North Korean nuclear test, our correspondent adds.
War crimes controversy
It was the first bi-lateral summit between Japan and China for five years.
China and South Korea's leaders had refused to meet Japan's previous premier, 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.
However, his successor was given a full ceremonial welcome when he arrived in China.
In Beijing, Mr Abe expressed remorse for Japan's wartime record, saying it would never forget the enormous damage and pain it had caused in Asia.
But he refused to comment on whether he plans to visit the controversial shrine.
"Whether I have or will visit the Yasukuni shrine is not something I will make clear," he said, "because it is a matter that has been turned into a diplomatic and political issue".
But despite seeing "eye-to-eye" on North Korea, correspondents say there are still a number of issues dividing China and Japan.
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.