Burlington County has banned Confederate flags at the local farm fair where two men stirred emotions last summer by displaying the stars and bars during a tractor parade at the end of the five-day event.

The Burlington County Board of Freeholders immediately reached out to fair organizers in July after hearing complaints, Freeholder Director Kate Gibbs said Thursday. All agreed to work on a policy barring the flag from future fairs while still considering free-speech rights.

"We're not going to take away anyone's free-speech rights," Gibbs said. "But when that speech turns into hate speech, we're not going to tolerate it."

The move comes as organizations and governments across the nation have been removing Confederate flags and statues following the 2015 Charleston, S.C., church massacre in which a gunman known to have carried the rebel flag killed nine African-American parishioners. That summer, amid protests, legislators took down the Confederate flag that had flown at South Carolina's capitol for more than 50 years.

Similar controversies erupted across the nation from big cities to small towns. In Philadelphia, the Kenney administration announced in November, also after months of protests, that the bronze statue of former Mayor Frank L. Rizzo would be relocated. To some, Rizzo was seen as an oppressor of blacks while police commissioner in the 1960s and mayor in the 1970s.

In New Jersey, Haddonfield received complaints about a historic Georgia flag with stars and bars that has been carried in the Fourth of July Parade by antiabortion activists. Tom Fox of Marlton said his group had no intention of offending anyone, but he understood the concerns.

"It never dawned on us that it should not be there. After I thought about it, I realized there must be a good reason why it had been removed in other places," Fox said in an interview Thursday. "Rest assured the flag will not be in the parade anymore."

Rosemary Kay has managed the Burlington County fair since 2012 and said she had never seen a Confederate flag at the fair in previous years. Last year, she said, its display was impromptu and "we took offense to it and asked them to take it down."

One of the men told officials the flag was meant to honor his great-grandfather and was not meant to promote hate, Gibbs said. She thinks both men understood the broader implications and will respect the new policy that exhibitors must read and sign when they register for the event.

"This is supposed to be a fun family event where none of our residents or visitors feel uncomfortable," Gibbs said. Although the fair is run independently of the county, it is held on county property. If the Confederate flags return in July, fair officials will request they be removed and officials can receive police assistance if needed.

The ban, Gibbs said, will be "vigorously defended."