WASHINGTON  The chairman of the Joint Chiefs of Staff has written an unusual open letter to all those in uniform, warning them to stay out of politics as the nation approaches a presidential election in which the wars in Iraq and Afghanistan will be a central, and certainly divisive, issue.

“The U.S. military must remain apolitical at all times and in all ways,” wrote the chairman, Adm. Mike Mullen, the nation’s highest-ranking officer. “It is and must always be a neutral instrument of the state, no matter which party holds sway.”

Admiral Mullen’s essay appears in the coming issue of Joint Force Quarterly, an official military journal that is distributed widely among the officer corps.

The essay is the first Admiral Mullen has written for the journal as chairman of the Joint Chiefs, and veteran officers said they could not remember when a similar “all-hands” letter had been issued to remind military personnel to remain outside, if not above, contentious political debate.