Image copyright AP Image caption US President Barack Obama has urged the House to pass gay rights legislation

President Barack Obama will sign an order banning federal government contractors from discriminating against gay and transgender workers, officials have said.

The executive order follows years of pressure from gay rights groups.

Mr Obama cannot extend the protection to all American workers, however.

The order comes after far broader anti-discrimination legislation stalled in the Republican-led House of Representatives.

The executive order will apply only to federal contractors, which employ nearly one-quarter of the US workforce.

"This is a major step forward in the struggle for freedom and justice for [lesbian, gay, transgender and "queer"] workers and their families," Rea Carey, executive director of the National Gay and Lesbian Task Force, said in a statement. "Now millions of people will have the economic security they need to provide for their families."

'Overwhelming support'

The Employment Non-Discrimination Act (Enda) passed the Democratic-controlled US Senate last year but has since languished in the House amid ongoing partisan political gridlock.

That legislation would bar employers with 15 or more workers from making employment decisions - hiring, firing or compensation - based on sexual orientation or gender identity.

Mr Obama urged the House of Representatives to pass the bill in November, saying it had "the overwhelming support of the American people, including a majority of Republican voters, as well as many corporations, small businesses and faith communities".

"One party in one house of Congress should not stand in the way of millions of Americans who want to go to work each day and simply be judged by the job they do," he added, addressing House Republicans.

But Republican House Speaker John Boehner opposes the bill, arguing it could lead to lawsuits and hinder job creation.

Mr Obama has used the power of the executive order before, once raising the minimum wage for federal contractors and also expanding the number of workers eligible for overtime pay.

There is currently no word on when Mr Obama plans to sign the order, but a White House official told US media the president had asked his staff to prepare the order for his signature.