The city’s upended reality kicked in only when his son, Santhush, asked him a question he struggled to answer: “Daddy, what is a curfew?”

While for many older residents the security measures are a flashback to the country’s dark days of war, for a generation that came of age in the past decade they are entirely disorienting.

“I have never experienced body checks before. When we came to work today we were thoroughly checked,” said Mohammed Imtisham, 18, a salesman in the city. “The feeling you get when they do it is not nice. It’s like they are treating us like criminals.”

Mr. Imtisham said the city felt besieged in a way that he had never experienced before.

“I have heard about curfews, but not experienced one,” he said. “This is a first. There is no freedom now. We have to go straight home after work. After everything settles, I hope we can go back to our normal lives.”

In the final years of the long war, the attacks in Colombo decreased in numbers. The vast security presence made infiltration difficult, and the Sri Lankan military took the fight to the rebel strongholds.

But even when the war ended, the siege mentality took time to recede.

“The political challenge was to demonstrate to the people that things were becoming normal. They rolled back the physical presence, but they would have maintained the intelligence. The military symbolism was rolled back quickly,” said Dr. Harinda Vidanage, the director of the Colombo-based Bandaranaike Center for International Studies.