A Marine Corps sergeant who criticized President Barack Obama in Facebook posts, generating a national furor, has been discharged from the military, the Marines said Wednesday.

Sgt. Gary Stein will be reduced in rank to lance corporal, effective next month, and will receive an "other-than-honorable discharge" for asserting he wouldn't follow orders from the commander-in-chief, in one instance writing "screw Obama" last month.

A lawyer for the American Civil Liberties Union, which is representing Sgt. Stein, said he would contest the discharge in federal court.

The case has become politically charged. Tea-party supporters rallied to Sgt. Stein's defense, arguing he has the First Amendment right to express his opinion about Mr. Obama. Critics said discipline is eroded when members of the military are allowed to make broad attacks on the chain of command.

Military leaders are sensitive to controversy over civilian control of the military and strive to demonstrate respect for civilian authority.