President Trump speaks to an audience including law enforcement officers at Suffolk Community College in Brentwood, N.Y., on July 28, 2017. (Spencer Platt/Getty Images)

When President Trump appeared to encourage police to rough suspects up during a July speech, he set off a national political firestorm. He also unknowingly sparked a fierce political debate in Annapolis, Md.

After Annapolis Police Chief Scott Baker watched Trump’s speech on Long Island, N.Y. — in which the president asked officers not to be “too nice” with suspects — Baker took to Facebook to denounce Trump’s words.

Whether Trump was joking — as the White House later claimed — or serious, the president’s comments “do not help build trust between citizens and police,” Baker wrote on the police department’s Facebook page Aug. 1, a day when residents and police across the country gathered to reinforce their relationships as part of National Night Out.

“The Annapolis Police Department has policies and procedures in place regarding how we interact with those we arrest,” Baker wrote. “Violations of these policies are considered serious and will be thoroughly investigated.”

Annapolis’s Republican mayor, Mike Pantelides, took issue with Baker’s post, which had accumulated more than 100 shares and 780 likes as of Wednesday afternoon.

Hours after Baker clicked “share,” Pantelides emailed department heads — including Baker — saying such posts as Baker’s distract from “our core mission of serving the citizens of Annapolis.” The mayor’s email was first reported by the Capital Gazette on Sunday.

Pantelides reiterated in the email an unwritten policy he said was often discussed in meetings with department heads: There should be no discussion of the president or national politics — positive or negative — on social media.

The mayor’s email provided fuel for his Democratic opponent John Astle in the coming mayoral race, who said it is a sign that the mayor “is taking his support for Donald Trump too far.”

“Shame on Pantelides for putting his loyalty to Donald Trump ahead of the needs of our community,” Astle, a state senator, wrote in a statement Tuesday.

Astle, who was a police officer in Baltimore for six years, told The Washington Post that Trump’s words “undercut the relationship of trust we’re trying to build between the community and the police.” Baker, he said, tried to rebuild that trust.

“Then the mayor undercut the police chief in public,” Astle said. Baker did not respond to requests for comment.

Gavin Buckley, the other Democratic mayoral candidate, also voiced his support for Baker.

“I want to thank Annapolis Police Chief Scott Baker for assuring our citizens that this is not who we are; Annapolis police officers do not undermine people’s trust by being heavy-handed,” Buckley wrote ina letter to the editor for the Capital Gazette. Buckley and Astle will face each other in the city’s primary Sept. 19.

Pantelides said his email was not about “violating anyone’s First Amendment rights.”

“This is about a policy of not bringing politics into our offices,” he said in a statement. “We work for the citizens of Annapolis.”