President Barack Obama signed an executive order on Monday barring federal contractors from discriminating on the basis of sexual orientation or gender identity, according to The Associated Press.

The order did not include new exemptions for religious organizations, a move that was welcomed by gay rights activists, the AP reported.

For a long time the White House has resisted issuing such an executive order, preferring instead to push for legislation in Congress that would ban discrimination against lesbian, gay, bisexual, and transgender people in workplaces nationwide, 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. workforce, according to the AP.

"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, the AP reported.

"And now, thanks to your passionate advocacy and the irrefutable rightness of your cause, our government - of the people, by the people, and for the people - will become just a little bit fairer," Obama added, according to the AP.

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," the AP reported. 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, according to the AP.

"Congress has spent 40 years - four decades - considering legislation that would help solve the problem. That's a long time, 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," Obama said, the AP reported.