The US Department of Justice has accused Facebook of discriminating against American workers by giving hiring preferences to immigrants.
A lawsuit alleges the social media firm refused to recruit, consider or hire qualified and available Americans for more than 2,600 positions.
Those jobs instead went to foreigners on temporary visas, the lawsuit says.
Facebook disputed the allegations, but said it was co-operating with the department.
The lawsuit concerns Facebook’s use of temporary H-1B visas, which are often used by tech companies to bring highly skilled foreign workers to the US.
In its lawsuit, filed on Thursday, the department alleged that Facebook “intentionally created a hiring system” that favoured H-1B visa holders and other temporary workers over Americans.
The department said it filed the lawsuit after a two-year investigation into Facebook’s hiring practices.
The lawsuit seeks “back pay on behalf of US workers denied employment at Facebook” among other remedies.
“Our message to workers is clear: If companies deny employment opportunities by illegally preferring temporary visa holders, the Department of Justice will hold them accountable,” said Eric S Dreiband, the assistant attorney general for the department’s civil rights division.
“Our message to all employers – including those in the technology sector – is clear: You cannot illegally prefer to recruit, consider or hire temporary visa holders over US workers.”
The Trump administration has had a strained relationship with tech firms in recent years. Big companies such as Facebook have faced criticism for allowing disinformation to be spread on their platforms and data to be misused.
Complaints of anti-competitive practices have also been levelled at the largest tech companies in the US by Democratic and Republican lawmakers.
In October, the Justice Department sued Google, accusing it of illegally maintaining its monopoly power in search and search advertising. Google denied the allegations, calling the litigation deeply flawed.
A few weeks before that, the House Judiciary Committee recommended taking action to break up the big-tech platforms, including Facebook, Amazon, Apple and Google.
Facebook has previously said it is not a monopoly and consumers can choose how to connect with friends online.