WASHINGTON — In an apparent expansion of the government’s secrecy powers, the top official in charge of the classification system has decided that it was legitimate for the Marines to classify photographs that showed American forces posing with corpses of Taliban fighters in Afghanistan.

President Obama’s executive order governing secrecy bars use of the classification system to cover up illegal or embarrassing conduct. But the official, John P. Fitzpatrick, the director of the Information Security Oversight Office, accepted the Marines’ rationale for classifying the photographs: that their dissemination could encourage attacks against troops.

Mr. Fitzpatrick laid out his conclusion in a May 30 letter to a Marine lawyer who had filed a whistle-blower complaint saying that the secrecy violated the executive order. It could be an important precedent for allowing the military to keep future war-zone photographs depicting abuses by American soldiers hidden from the public.

The decision stands in contrast to the government’s position in a legal fight over hundreds of photographs depicting the abuse of detainees in Iraq, which the American Civil Liberties Union sought in a long-running Freedom of Information Act lawsuit.