PYEONGCHANG, South Korea — Security is a top concern at every Olympics, where athletes and fans in scattered venues can be difficult to protect. But rarely do they take place in the shadow of a nuclear standoff, as is the case with the Winter Games that open next week here in South Korea.

Nearly 3,000 athletes from 92 nations and 100,000 spectators per day are expected to converge on the area around Pyeongchang, 50 miles from the North Korean border, for what organizers say will be the largest-ever Winter Games. The South has mobilized tens of thousands of security personnel — including 50,000 soldiers — in what may be the most militarized security force in Olympic history.

A last-minute diplomatic breakthrough in which North Korea agreed to participate in the Games has pushed fears of worst-case scenarios into the background, at least for now. But the North remains the most unpredictable factor in security arrangements, because it has a history of engaging in violence when South Korea hosts international sports events.

The arrival Thursday of a delegation of North Korean athletes — part of a larger contingent of around 500 athletes, officials and performers — raises a separate set of security challenges, including protecting them from attacks by extremists in South Korea.