WASHINGTON — The US House of Representatives approved a bill Thursday that would ban the federal government from ordering an employer to shut down plants or relocate workers, even if labor laws were violated.

Approved in a 238-186 vote in the Republican-dominated House, the measure stems from a labor dispute pitting federal authorities against Boeing.

It must still face a vote in the Senate, where it will likely meet opposition from Democrats, who are in the majority there.

In April, the National Labor Relations Board filed a complaint alleging that aeronautical giant Boeing violated labor laws when it opened a production line for its 797 Dreamliner jet in South Carolina, claiming the move sought to punish unionized workers from the company's headquarters in Washington state.

Boeing disputes the allegations.

"At a time when millions of Americans are out of work, it is astounding that Washington would take any action to stop the private sector from creating jobs," the House's number two Republican, Eric Cantor, said in a statement after the vote.