President Barack Obama on Monday signed an executive order that prohibits federal contractors from discriminating against employees on the basis of sexual orientation and gender identity.

In remarks delivered before he signed the order, the president told a crowd gathered at the White House: “We're on the right side of history.”

(Related: Obama signs gay workplace protections order.)

“It doesn’t make much sense, but today in America, millions of our fellow citizens wake up and go to work with the awareness that they could lose their job, not because of anything they do or fail to do, but because of who they are – lesbian, gay, bisexual, transgender. And that’s wrong,” the president said. “We’re here to do what we can to make it right – to bend that arc of justice just a little bit in a better direction.”

“Currently, 18 states have already banned workplace discrimination based on sexual orientation and gender identity. And over 200 cities and localities have done the same. Governor Terry McAuliffe is here; his first act as governor was to prohibit discrimination against LGBT employees of the Commonwealth of Virginia.”

“Equality in the workplace is not only the right thing to do, it turns out to be good business. That’s why a majority of Fortune 500 companies already have nondiscrimination policies in place. It is not just about doing the right thing – it’s also about attracting and retaining the best talent. And there are several business leaders who are here today who will attest to that.”

“And yet, despite all that, in too many states and in too many workplaces, simply being gay, lesbian, bisexual or transgender can still be a fireable offense. There are people here today who’ve lost their jobs for that reason. This is not speculative, this is not a matter of political correctness – people lose their jobs as a consequence of this. Their livelihoods are threatened, their families are threatened. In fact, more states now allow same-sex marriage than prohibit discrimination against LGBT workers. So I firmly believe that it’s time to address this injustice for every American.”

Now, Congress has spent 40 years – four decades – considering legislation that would help solve the problem. That's a long time. And yet they still haven’t gotten it done. Senators Tammy Baldwin and Jeff Merkley are here. They have been champions of this issue for a long, long time. We are very proud of them. I know they will not stop fighting until fair treatment for all workers is the federal law of the land. Everyone thanks them for that.”

“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.”

“For more than two centuries, we have strived, often at great cost, to form 'a more perfect union' – to make sure that 'we, the people' applies to all the people. Many of us are only here because others fought to secure rights and opportunities for us. And we’ve got a responsibility to do the same for future generations. We’ve got an obligation to make sure that the country we love remains a place where no matter who you are, or what you look like, or where you come from, or how you started out, or what your last name is, or who you love – no matter what, you can make it in this country.”

“That’s the story of America. That’s the story of this movement. I want to thank all of you for doing your part. We've got a long way to go, but I hope as everybody looks around this room, you are reminded of the extraordinary progress that we have made not just in our lifetimes, but in the last five years. In the last two years. In the last one year. We're on the right side of history.” (The video is embedded on this page. Visit our video library for more videos.)