HERAT, Afghanistan — It was supposed to be a grand moment for President Ashraf Ghani of Afghanistan — the opening of a new trade corridor that brought his landlocked country a link to Europe through Central Asia, and promised him some rare positive news as a re-election campaign approaches.

But what grabbed the headlines after Thursday’s event was chaos and violence.

Members of the president’s staff, in front of hundreds of people, assaulted a young member of the crowd who wanted to hand a petition to the president. Videos posted on social media in the days since portray an even more chaotic scene, with the president screaming at and slapping one of his own aides for mistreating the young man.

Mr. Ghani’s elite guards, the Presidential Protective Service, continued to assault the man once he was taken out of the president’s sight, footage suggests, and he remains in detention.

It was not an isolated incident. Those who guard senior Afghan officials — undoubtedly a difficult task in one of the most dangerous countries in the world — have repeatedly assaulted civilians, including journalists. In most cases, there is no indication that anyone was held accountable, further fueling a widespread culture of violence with impunity.