(CNN) The Navy secretary is urging military personnel to remain apolitical weeks after a controversy in which the White House asked for the USS John McCain to be kept out of President Donald Trump's sight during his visit to Japan.

In a memo issued last week, Navy Secretary Richard V. Spencer highlighted the importance of not taking sides as the election season gets closer.

"It is appropriate for us to remember that as military professionals, we are an apolitical body and our members cannot participate in activities that could appear to imply sponsorship, approval, or endorsement of a political candidate, campaign or cause," it says.

"I want our Sailors, Marines and civilian employees to carry out the obligations of citizenship, including permitted political activities. At the same time, I require our service members and civilian employees to be aware of the difference between permitted and prohibited activities."

It states no employee should engage in a political activity while on duty or in a federal building. "For any questions about what activities are permitted, please contact your local legal office," the memo says.

Read More