WASHINGTON — President Obama sharply rebuked his Republican rivals Saturday, saying anyone who wants to be commander in chief must support the entire U.S. military, including gay service members.

A combative Obama criticized Republican presidential candidates for staying silent when the crowd at a recent debate booed a gay soldier who asked a question of the contenders via videotape.

“You want to be commander in chief? You can start by standing up for the men and women who wear the uniform of the United States, even when it’s not politically convenient,” Obama said in remarks at the annual dinner of the Human Rights Council, the nation’s largest gay rights organization.

Referencing the boos at the Sept. 22 Republican debate, he said: “We don’t believe in standing silent when that happens.”

Obama touted his administration’s efforts to repeal the military’s ban on openly gay service members, as well as his orders to the Justice Department to stop enforcing a law defining marriage as between one man and one woman.

But, as expected, Obama stopped short of endorsing gay marriage, saying only that “every single American deserves to be treated equally in the eyes of the law.”

Obama has said his views on gay marriage are “evolving”, but for now he only supports civil union.

Obama’s position on gay marriage has become a sore point for some gay activists, who say they’re otherwise pleased with the president’s handling of issues important to them.

The president’s position on gay marriage puts him at odds with some of his supporters. Numerous recent polls suggest a slight majority of Americans favor giving same-sex couples the right to marry, and support is highest among Democrats and young people.