The statement, adopted unanimously by the council and read at a formal meeting, warns North Korea that carrying out a nuclear test would bring international condemnation, "jeopardize peace, stability and security in the region and beyond," and lead to further unspecified council action.
The U.N. action came as Japan's vice foreign minister said the test could come as early as this weekend, the anniversary of Kim's appointment as head of the Korean Workers' Party in 1997. Japan said it was stepping up monitoring of North Korea.
Still shots of Kim waving to an assembled crowd of 500 olive-suited officers aired on North Korean state television. The country's official Korean Central News Agency said the communist leader was greeted with rousing cheers of "Fight at the cost of our lives!" by his top brass as he urged them to bolster the nation's defenses.
Kim later posed for a group photo with his commanders in front of Pyongyang's sprawling mausoleum for his father and national founder, Kim Il Sung.
The presidential statement, which becomes part of the Security Council's formal record, says the council "deplores" the pursuit of nuclear weapons by the Democratic People's Republic of Korea, North Korea's official name which is referred to by its initials, the DPRK.
"The Security Council will be monitoring the situation closely," the statement says. "The Security Council stresses that a nuclear test, if carried out by the DPRK, would represent a clear threat to international peace and security and that should the DPRK ignore calls of the international community, the Security Council will act consistent with its responsibility under the Charter of the United Nations."
U.S. Ambassador John Bolton said the U.S. priority now is to stop a North Korean test.
"North Korea should understand how strongly the United States and many other council members feel that they should not test this nuclear device," Bolton said, "and that if they do test it, it would be a very different world the day after the test ... because there would be another nuclear power."
"This would be proof positive of North Korea having nuclear weapons. It would be an example of nuclear proliferation that we're very much concerned about," he said.
Russia's U.N. Ambassador Vitaly Churkin said threatening or conducting a nuclear test "would not help anybody including North Korea."
"This message is very clearly conveyed in the useful presidential statement which we today adopted," he said. "Let's hope that things will cool off and that everybody will return to six-party talks."
The meeting was the reclusive leader's first reported appearance in three weeks and the first since Tuesday, when his government shocked the world by announcing plans to test a nuclear device on its way to building an arsenal of atomic weapons.
It was unclear when the rally took place, or how many attended, but it could show that Kim is trying to polish his credentials with the country's cherished military at a time when international pressure is mounting on Pyongyang.
The KCNA dispatch made no mention of a nuclear test.
Kim's last reported public activity was when KCNA reported on Sept. 15 that he visited the scenic Diamond Mountain near the border with South Korea.
The North claims to have nuclear weapons, but hasn't performed any known test to prove that. Six-nation talks aimed at persuading North Korea to abandon its nuclear ambitions have been stalled for almost a year, and North Korea says it needs an atomic arsenal to deter a possible attack from the United States.
Washington has repeatedly said it has no intention of invading North Korea.
Japanese Vice Foreign Minister Shotaro Yachi, currently in Washington, told the Japan's TV Asahi:
"Based on the development so far, it would be best to view that a test is possible this weekend."
Japan stepped up monitoring of North Korea.
"In consideration of various possibilities, we are preparing for whatever may happen," Chief Cabinet Secretary Yasuhisa Shiozaki said.
Japan has two intelligence-gathering satellites and launched a third in September that can monitor the North's nuclear weapons and missile programs.
On Thursday, a U.S. military plane capable of detecting radiation took off from Okinawa in southern Japan, thought to be a monitoring exercise in case North Korea carries out a test, according to media reports.
The statement also urges North Korea to work toward implementation of a September 2005 agreement in which the North pledged to give up its nuclear program in exchange for aid and security guarantees. The six-party talks involve the two Koreas, the United States, China, Japan and Russia.
North Korea has boycotted the six-nation talks since late last year, angered by American financial restrictions imposed over the North's alleged illegal activities such as money laundering and counterfeiting.
The Associated Press contributed to this report.