POUGHKEEPSIE, N.Y. (CBSNewYork/AP) — American flags will be reinstalled on some of the fire trucks in a Hudson Valley community where the U.S. banners had been removed, sparking a heated debate that drew national attention.

Fire commissioners in the Arlington Fire District in the town of Poughkeepsie had ordered the large flags removed from the back of three fire engines earlier this month.

The move was made over concerns about possible U.S. flag code violations and potential safety risks to firefighters and motorists.

An agreement announced Thursday will allow smaller 2-foot-by-3-foot American flags on three of the district’s front-line engines, which are the fire trucks used most frequently.

“Safety concerns and compliance with the United States Flag Code, as well as both parties’ unwavering allegiance to and respect for the Nation’s flag, were the guiding principles to this resolution,” officials said in a Facebook post. “The flags will be positioned in a way as to not interfere with the access and functions of the fire equipment.”

Amid the debate over the mid-August decision, officials decided to allow a large flag on one fire truck. That compromise failed to quell the controversy.

(TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)