Japan and China agreed Sunday that a North Korea nuclear test "cannot be tolerated" and that Pyongyang should return unconditionally to six-party negotiations on its nuclear programs, the Japanese prime minister said.

Shinzo Abe, speaking to reporters at the end of a day of meetings in Beijing, said he and China's President Hu Jintao agreed that a North Korean nuclear test would be unacceptable.

"We need to prevent a nuclear North Korea," Abe said. "We saw eye-to-eye that North Korea's announcement of a nuclear test cannot be tolerated because it is a great threat to East Asia and the international community."

CountryWatch: North Korea

The two leaders — meeting for the first summit-level talks between their countries in five years — urged North Korea to rejoin the six-nation talks, Abe said. Pyongyang has refused to attend the talks for more than a year to protest financial sanctions imposed by the United States.

The United States has refused to meet with North Korea outside of the negotiations by the Koreas, the United States, Japan, China and Russia. Washington has said it would have bilateral talks with North Korea only in the context of those six-party talks.

"President Bush and administration officials have made our position on bilateral talks clear," said Emily Lawrimore, a White House spokeswoman. "We will continue to encourage North Korea to participate in six-party talks."

Abe's Beijing trip, intended to ease tense relations between the two east Asian nations, took on added urgency after North Korea's announcement last Tuesday that it would conduct a nuclear test at an unspecified time.

Meanwhile, a former South Korean lawmaker said North Korea denied a nuclear test was imminent, citing a Chinese diplomat who spoke to officials from the North on Sunday. China is North Korea's closest ally.

There had been speculation that a nuclear test could come Sunday, the anniversary of North Korean leader Kim Jong Il's appointment as head of the Korean Workers' Party in 1997.

However, former South Korean lawmaker Jang Sung-min said the North told China it had not raised the alert level of its military. He said he spoke to an unidentified Chinese diplomat who learned of North Korea's stance from Pyongyang officials Sunday afternoon.

Jang said the North also told China it may drop plans to test its first atomic bomb if the United States holds bilateral talks with Pyongyang — or accelerate the plans if the U.S. moves toward sanctions or a military attack. The United States has repeatedly denied it intends to invade North Korea.

Jang, who spoke in Seoul, is a former ruling party lawmaker who currently heads a think tank in Seoul and has been active in Northeast Asian affairs.

The Chinese official's comments could not be independently confirmed.

Persuading China and South Korea to support forceful diplomacy and potentially tough sanctions against Pyongyang is seen as crucial. Over the past three years, Beijing and Seoul have resisted sanctions and argued for engagement as the best way to deal with the isolated regime.

But calls for a harder line have mounted since North Korea's latest threat, with jittery nations warning that a test would unravel regional security and possibly trigger an arms race.

The U.N. Security Council issued a stern statement Friday urging the North to abandon its nuclear ambitions and warning of unspecified consequences.

Japan's Foreign Ministry said it was prepared to push for punitive measures at the United Nations if the North goes ahead with the test.

A top Japanese ruling party official warned of further sanctions if North Korea conducts a nuclear test. Tokyo began stepping up trade restrictions on North Korea in July after it test-fired seven missiles, including a long-range rocket, into the waters between Japan and the Korean Peninsula.

"We have already imposed financial measures ... but we may have to go further, like stopping imports and exports [from North Korea]" if it conducts a nuclear test, Shoichi Nakagawa, the Liberal Democratic Party's policy chief, said on public broadcaster NHK.

A midday incursion Saturday by North Korean troops into the southern side of the no-man's-land separating North and South Korea only stoked tensions.

South Korean soldiers rattled off 40 warning shots at the five communist troops who crossed the center line of the Demilitarized Zone.

It was unclear whether the North Korean advance was intended as a provocation, or was an attempt to go fishing at a nearby stream, an official at South Korea's Joint Chiefs of Staff said on condition of anonymity, citing official policy. No one was hurt, and the North Koreans retreated.

While such border skirmishes are not unheard of, they are relatively rare. Saturday's incursion was only the second this year, the official said.

North Korea said Tuesday it decided to act in the face of what it claimed was "the U.S. extreme threat of a nuclear war."

Talks between Abe and Chinese leaders also focused on mending diplomatic ties.

China canceled previous meetings to protest former Japanese Prime Minister Junichiro Koizumi's visits to a Tokyo war shrine seen as a symbol of Japan's imperialist past. A handful of war criminals are worshipped in the shrine along with the rest of Japan's fallen soldiers.