The order did not include new exemptions for religious organizations, a move that was welcomed by gay rights activists.
But that legislation stalled in Congress, and advocates pressed Obama to take action to bar such discrimination among federal contractors, who make up about a fifth of the U.S. work force.
“Many of you have worked for a long time to see this day coming. You organized, you spoke up, you signed petitions, you sent letters - I know because I got a lot of them,” Obama said to laughter from a crowd of advocates at the White House.
“And now, thanks to your passionate advocacy and the irrefutable rightness of your cause, our government - government of the people, by the people, and for the people - will become just a little bit fairer.”
In the 1960s, President Lyndon Johnson signed an order prohibiting federal contractors from discriminating “against any employee or applicant for employment because of race, color, religion, sex, or national origin.” Obama's executive order added sexual orientation and gender identity to the list of protected categories.
Obama urged participants to continue working for anti-discrimination legislation that would apply to all employers.
“Congress has spent 40 years - four decades - considering legislation that would help solve the problem. That's a long time,” he said.
“But I'm going to do what I can, with the authority I have, to act. The rest of you, of course, need to keep putting pressure on Congress to pass federal legislation that resolves this problem once and for all.”