A federal court has ruled that a prohibition by a Pennsylvania community on the display of the American flag with a thin blue line that is supportive of law enforcement is unconstitutional. 

The Springfield Township, about 15 miles from Philadelphia, argued the use of the flag was creating "discontent and distrust" in the community against the police. However, U.S. District Judge Karen Marston ruled the ban restricts the free speech of public employees under the First Amendment.

"The Township repeatedly suggests that the ‘Thin Blue Line' American Flag is of limited, if any, public value or concern because it is ‘offensive’ and ‘racist,’" Marston wrote in the court opinion. "But as this Court previously told the Township, ‘the First Amendment protects speech even when it is considered ‘offensive.’"

CALIFORNIA MOMS DEFEND STUDENTS' RIGHT TO FLY ‘THIN BLUE LINE’ FLAG AFTER FOOTBALL PLAYERS DEFY BAN

A photo of a thin blue line flag

A "Thin Blue Line" flag, signaling support for law enforcement is displayed. A federal court has ruled that a Pennsylvania township can't ban an American flag with a thin blue line from being publicly displayed. (Stefani Reynolds/AFP via Getty Images)

Marston said the township's calling the flag various names bordered on unprofessional. She conceded that it was "undeniable that the Flag carries racist undertones to certain members of the community."

Wally Zimolong, an attorney representing the police officers, said the court's ruling was a vindication of his clients' claims.

"It was a resounding win for the First Amendment and free speech," he said. "It showed once again that the government cannot engage in viewpoint discrimination based upon a message it disagrees with or finds offensive."

MARYLAND COUNTY EXEC BANS POLICE STATION FROM DISPLAYING ‘DIVISIVE’ ‘THIN BLUE LINE’ FLAG

Thin Blue Line flag at Seattle City Hall

A "Thin Blue Line" flag outside Seattle City Hall. (Noah Riffe/Anadolu Agency via Getty Images/File)

Tensions over the flag began when the city's police union voted in 2021 to incorporate the flag into its logo. Several township commissioners opposed the move because the flag had become associated with Blue Lives Matter, which has been used by police supporters in response to Black Lives Matter. 

The union voted to deny a request by commissioners to change it, despite the township offering to pay up to $10,000 to change it. Last year, the township's attorney sent a cease-and-desist letter to the union.

The letter said the use of the flag in the union’s logo "unnecessarily exacerbates the ongoing conflict between police officers and the communities they serve," and directed the union to stop using the flag or remove Springfield Township from its name.

CLICK TO GET THE FOX NEWS APP

After the union refused to drop the flag or change its name, the commissioners adopted a policy that barred township employees, agents or consultants from displaying the flag while on duty or representing the township.

Fox News Digital has reached out to township commissioners. 

The Associated Press contributed to this report.