The Minneapolis Police Department announced a policy change prohibiting off-duty officers from wearing their uniforms at political rallies or when publicly endorsing candidates.

At a news conference on Tuesday, police Chief Medaria Arradondo said he wants to ensure that the community knows the police department is not "showing favor or bias toward a particular political party or a candidate."

"It is very important for me as chief to ensure that our policies are in line with our mission and our values," he said.

The move drew opposition from the head of the city's police union. He questioned the timing of the policy change, as it comes a little over a week before a scheduled rally by President Donald Trump which the city's mayor has openly criticized.

Mayor Jacob Frey last week condemned President Donald Trump's planned campaign rally on Oct. 10 at the Target Center.

“Our entire city will stand not behind the president, but behind the communities and people who continue to make our city — and this country — great,” Frey said, according to the Star Tribune. “While there is no legal mechanism to prevent the president from visiting, his message of hatred will never be welcome in Minneapolis.”

Both Arradondo and Frey said the police department's policy change is not connected to Trump's visit and had been in the works for over a year. The chief said that he began to review the policy after community members complained last year about seeing Minneapolis officers in uniform endorsing local- and state-level elected officials.

"I don't want the Minneapolis Police Department to be politicized, at all," Arradondo said at the news conference Tuesday.

Frey made similar comments at a separate news conference Tuesday.

"The Minneapolis Police Department is neither an ideological or political entity. It's not Democrat. It's not Republican. And we want people to understand that this is a neutral department," Frey told reporters.

But, Bob Kroll, head of the Minneapolis Police Federation, said he does not support the policy change and questions the timing of it.

“We've always been allowed to wear our uniform,” he told NBC affiliate KARE in Minneapolis. “The timing of it is very conspicuous and then (there’s) the fact that they didn't go through the normal policy change process with this. It's changed and that's the end of it.”

Kroll told NBC News on Wednesday that his union has typically weighed in on policy reviews in the past, but that they were not told in advance of the latest change.

A police spokesman told NBC News that the policy change goes into effect on Friday.

Arradondo said it does not apply to officers who are working in their "normal capacity" at a political event and said there will be "numerous" uniformed officers at Trump's rally.