Four major technology companies, including Apple and Google, have agreed to pay a total of $324m (€234m) to settle a lawsuit accusing them of conspiring to hold down salaries in Silicon Valley, sources familiar with the deal said.

The settlement comes just weeks before a high-profile trial had been scheduled to begin.

Tech workers filed a class action lawsuit against Apple, Google, Intel and Adobe Systems in 2011, alleging they conspired to refrain from soliciting one another's employees in order to avert a salary war.

They planned to ask for $3 billion in damages at trial, according to court filings. That could have tripled to $9 billion under competition law.

The case has been closely watched due to the potentially high damages award and the opportunity to glimpse into the world of Silicon Valley's elite.  

The case was based largely on emails in which Apple's late co-founder Steve Jobs, former Google CEO Eric Schmidt and some of their Silicon Valley rivals hatched plans to avoid poaching each other's prized engineers. 

In one email exchange after a Google recruiter solicited an Apple employee, Mr Schmidt told Mr Jobs that the recruiter would be fired, court documents show.

Mr Jobs then forwarded Mr Schmidt's note to a top Apple human resources executive with a smiley face. 

Another exchange shows Google's human resources director asking Mr Schmidt about sharing its no-cold call agreements with competitors. Mr Schmidt, now the company's executive chairman, advised discretion.

"Schmidt responded that he preferred it be shared 'verbally, since I don't want to create a paper trail over which we can be sued later?'" he said, according to a court filing. The HR director agreed. 

The companies had acknowledged entering into some no-hire agreements but disputed the allegation that they had conspired to drive down wages. They also argued that the employees should not be allowed to sue as a group. 

The trial had been scheduled to begin at the end of May on behalf of roughly 64,000 workers. 

Spokespeople for Apple, Google and Intel declined to comment.

An Adobe representative said that the company denies it engaged in any wrongdoing, but settled "in order to avoid the uncertainties, cost and distraction of litigation".

An attorney for the plaintiffs, Kelly Dermody of Lieff Cabraser Heimann & Bernstein, in a statement called the deal "an excellent resolution".