SAN FRANCISCO (Reuters) - Four major tech companies including Apple and Google have agreed to pay a total of $324 million to settle a lawsuit accusing them of conspiring to hold down salaries in Silicon Valley, sources familiar with the deal said, just weeks before a high profile trial had been scheduled to begin.

A Google logo is seen at the garage where the company was founded on Google's 15th anniversary in Menlo Park, California September 26, 2013. REUTERS/Stephen Lam

Tech workers filed a class action lawsuit against Apple Inc, Google Inc, Intel Inc and Adobe Systems Inc 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 antitrust law.

The case has been closely watched due to the potentially high damages award and the opportunity to peek 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, Schmidt told Jobs that the recruiter would be fired, court documents show. Jobs then forwarded Schmidt’s note to a top Apple human resources executive with a smiley face.

Another exchange shows Google’s human resources director asking Schmidt about sharing its no-cold call agreements with competitors. 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. Moreover, they argued that the employees should not be allowed to sue as a group.

Rich Gray, a Silicon Valley antitrust expert in private practice, said the companies had an incentive to avoid trial because their executives’ emails would make them look extremely unsympathetic to a jury. However, the plaintiff attorneys risked an appeals court saying the engineers could not sue as a group at all.

“An appellate court could say, ‘Hey we just don’t buy that,’” Gray said.

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.”

Corporate defendants in antitrust cases often agree among themselves what portion each will contribute towards a settlement, said Daniel Crane, a professor at the University of Michigan Law School. One likely formula would be to divide the damages based on how many employees each company has in the class, he said.

Apple, Google, Adobe and Intel in 2010 settled a U.S. Department of Justice probe by agreeing not to enter into such no-hire deals in the future. The four companies had since been fighting the civil antitrust class action.

Walt Disney Co’s Pixar and Lucasfilm units and Intuit Inc had already agreed to a settlement, with Disney paying about $9 million and Intuit paying $11 million.

Any settlement must be approved by U.S. District Judge Lucy Koh in San Jose, California. A hearing on final approval of the Intuit and Disney deals is scheduled for next week.

The plaintiffs and the companies will disclose principal terms of the settlement by May 27, according to the court filing on Thursday, though it is unclear whether that will spell out what each company will pay.

Some Silicon Valley companies refused to enter into no-hire agreements. Facebook Chief Operating Officer Sheryl Sandberg, for instance, rebuffed an entreaty from Google in 2008 that they refrain from poaching each other’s employees.

Additionally, Apple’s Jobs threatened Palm with a patent lawsuit if Palm didn’t agree to stop soliciting Apple employees. However, then Palm Chief Executive Edward Colligan told Jobs that the plan was “likely illegal,” and that Palm was not “intimidated” by the threat.

The case in U.S. District Court, Northern District of California is In Re: High-Tech Employee Antitrust Litigation, 11-cv-2509.