After years of pressure from gay rights groups, President Obama is set to sign an executive order that would ban federal contractors from discriminating against employees on the basis of sexual orientation and gender identity, a White House official has told the Associated Press.

The Obama administration has said it would prefer Congress to pass legislation that broadly extends workplace protections to all US employees. Such a bill passed the Senate last year but remains stalled in the Republican-dominated House.

Discriminating against employees on the basis of sexual orientation or gender identity is not explicitly banned under US law, and Obama does not have the authority to extend such workplace protections to all US employees. He can, however, take action to bar employers from firing or harassing workers employed by companies that work with the US government because of their sexual orientation or gender identity. This would not require legislative approval.

A study by the Williams Institute thinktank at UCLA law school, found that the order would cover up to nearly 16 million workers and about 14 million workers would gain extra protections.

The White House said the order will build on previous orders that aim to ban workplace discrimination on the basis of race, color, religion, sex, or national origin.

The official did not say when Obama planned to sign the order – just that he has asked staff to prepare the draft for his signature.

Obama, the first sitting president to endorse same-sex marriage, is scheduled to travel to New York on Tuesday for the Democratic national committee’s annual gay and lesbian fundraiser. In the past, the event has urged LGBT donors to press the president on the issue.

DNC chair Debbie Wasserman Schultz said in a statement on Monday: "President Obama’s decision to sign an executive order to ban discrimination on the basis of sexual orientation or identity for federal contractors marks another significant step in our nation’s progress on civil rights.

"As the president has said, 'in the United States, who you are and who you love should never be a fireable offense'."

Rea Carey, the executive director of the National Gay and Lesbian Task Force, called the order a “major step forward”.

“Through his actions, the president has demonstrated again his commitment to ending discrimination,” Carey told the AP.