SOCHI, Russia — This may now be the safest city in Russia.

Even as a frantic rush of construction rattles on less than three weeks before the opening of the Winter Olympics, the government of President Vladimir V. Putin has put in place what officials and experts described as the most intensive security apparatus in the history of the event, one that critics say threatens to temper the spirit of the Games.

In addition to deploying tens of thousands of police and military reinforcements to the Sochi area, the government has tightened control inside the city ahead of the opening of the Games on Feb. 7, imposing a ban on vehicles that are not registered in the region and requiring even Russians who visit to register with the police within three days, as foreigners must do.

The threat of terrorism has become a grim reality of major sporting events — from marathons in the wake of the Boston bombings last year to this year’s Super Bowl at the Meadowlands in New Jersey.

With the Winter Olympics being held near a simmering Islamic insurgency just over the Caucasus Mountains, the threat here has been particularly acute, as have Russia’s preparations.