The United Nations barred a visitor from entering the world body's headquarters last week because she was wearing a patch on her coat with the words "Black Lives Matter," saying on Tuesday that the ban is in keeping with long-standing U.N. rules.

The sentence "Black Lives Matter" has become a rallying cry for demonstrators across the United States protesting grand jury decisions not to charge white police officers in the killings of unarmed black men in Ferguson, Missouri, and New York City.

A security officer told the woman who attempted to enter the United Nations in New York City on Friday that the patch on her coat would violate a ban on political protests inside the U.N. compound. She was allowed to enter after removing it.

"There is a long-standing organizational policy that does not permit visitors to come in wearing political messages, display banners or distribute leaflets outside of a planned event and with proper authorization," U.N. spokesman Stephane Dujarric said at a news conference. "In this case the security officer acted properly in accordance with regulation."

After a U.S. grand jury last month cleared a white police officer in the fatal August shooting of an unarmed black teenager in Ferguson, U.N. Secretary-General Ban Ki-moon spoke out in support of the right of demonstrators to peacefully protest.

Reuters spoke with the woman involved in the incident but she declined to be identified. Although the United Nations is in New York City, it is international territory administered by the U.N. secretariat.