WELLINGTON, New Zealand — In New Zealand, members of the public are accustomed to seeing their top government officials at the grocery store or on the street, unencumbered by security guards as is more common in other parts of the world.

The country’s prime minister, Jacinda Ardern, even jokingly recounted to Stephen Colbert on the “The Late Show” about being approached by chatty strangers while she shopped for maternity bras.

But on Thursday morning, a government minister was attacked while walking to work alone in the capital city, leading Ms. Ardern to warn that New Zealanders’ unusual level of access to the country’s lawmakers should not be taken for granted.

“We have an environment in New Zealand where politicians are accessible, and that’s something we should feel proud of,” Ms Ardern said. “We are, after all, here to serve people. But today’s events really show we cannot take that for granted.”