“The parties have reached a settlement agreement in principle and began negotiating the terms of a long form settlement agreement,” according to court documents filed by both sides, seen by the BBC.

Details of the agreement are not yet public and will require the courts’ approval.

The lawsuit, led by former Twitter employee Courtney McMillian, says about 6,000 people were wrongly denied benefits under the company’s severance plan.

They argued that the firm had failed to provide payments as high as six months’ worth of salaries, among other terms.

But Twitter only gave sacked workers at most one month of severance pay, while some did not receive anything, according to the lawsuit.

Musk axed thousands of Twitter staff globally, downsizing the platform’s trust and safety, human rights and media teams.

The Twitter layoffs was among the earliest in a series of retrenchments among tech firms to cut costs. Rank-and-file workers were often first to be laid off.

Many companies had gone on a hiring spree during the early days of the Covid-19 pandemic when the use of digital tools grew.

Companies like Facebook, Google and Microsoft laid off tens of thousands of workers in the years that followed.

Musk, who was appointed for several months to helm President Donald Trump’s Department of Government Efficiency, made similar moves when he axed thousands of federal workers earlier this year.

The department was tasked with reducing US government spending and cutting jobs.

Additional reporting by Lily Jamali