Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

POCHEON, South Korea — Nuclear weapons secured the deal with South Korea and ended a dangerous military standoff, according to North Korean leader Kim Jong Un.

Putting his own spin on the accord reached Monday after marathon all-night talks, the pact "was by no means something achieved on the negotiating table, but thanks to the tremendous military muscle with the nuclear deterrent for self-defense," Kim told a meeting of the his Central Military Commission, according to a report Friday by the North’s official KCNA news agency.

North Korea is believed to have a handful of nuclear warheads but not the technology to launch them long distances.

Kim reportedly called the accord a "landmark occasion," paving the way for improved relations — he also sacked several top military officials.

Spectators watch the South Korea-United States joint military drills on Monday. Ian Williams, NBC News

In reality, the deal was a triumph of mutual pragmatism over mutual loathing. It didn’t prevent the U.S. and South Korea pressing ahead this week with joint military exercises, described by one South Korean official as the biggest of their type the allies have ever held.

NBC News was invited Monday to witness a live-fire drill held near the town of Pocheon, 15 miles south of the Demilitarized Zone (or DMZ) that runs along the rivals' border.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Some 4,000 members of the public were invited to witness the event. They sat in a makeshift grandstand on a hillside above the vast valley, waving flags and cheering every massive bang and boom.

Fighter jets swooped in and artillery was unleashed, pounding targets dotted across the landscape and shaking the earth on impact.

Tanks roll across the valley floor near the city of Pocheon, South Korea, during joint military exercises with the United States on Monday. Ian Williams, NBC News

Through a loudspeaker, barely audible at times, a commentator explained that the drill had three parts: a controlled response to a provocation, followed by repelling an invasion, followed by the a counter attack. The ecstatic crowd — as well as this correspondent — probably didn’t altogether grasp those subtleties.

During a brief pause in hostilities, the loudspeakers blared patriotic music and old news reports of North Korean provocations over the years.

Then there were wave after wave of helicopter gunships, pumping missiles and gunfire, while bigger rockets flashed across the valley. Dozens of tanks swept across the valley floor, pumping shells out ahead of them.

It all ended with a grand crescendo of noise, fire and smoke.

Targets set out along the valley floor during South Korea's Joint exercises with the United States on Monday. Ian Williams, NBC News

The allies had won. We knew that because artillery shells exploded in the air above the valley in the shape of large V for victory.

The audience cheered and waved their flags with vigor. The commentator declared: "We are going to defend our country."

With a fog still hanging over the pummeled valley, and a strong stench of cordite in the air, NBC News met Captain Jason Yu of the U.S. Army, standing near an artillery piece and looking like this was all in an afternoon’s work.

"We are ready to face any provocative actions coming from the North and able to defend the Republic of Korea," he said. "We are showing our joint capabilities, as well as our combined assets that are available should a provocation occur."

This month’s standoff with the North was one of the most serious for years. It had its roots in a landmine explosion earlier this month, which badly injured two South Korean soldiers on patrol.

The South blamed the North and restarted propaganda broadcasts across the border that were halted 11 years ago. The North described this as an affront to Kim’s dignity and demanded they stop or else.

An artillery exchange followed and then an ultimatum from the North. The tension eventually diffused by the face-saving deal, which enables both sides to appear statesmanlike.

The deal certainly has pulled the two sides back from the brink — for now — and in theory at least it commits them to further dialogue.

Whether that happens, and how quickly, will be the test of whether it is a deal really with lasting benefits, or is just a short-term fix to end a standoff that both recognized had reached a dangerous impasse.