Updated

Former Microsoft Corp. (MSFT) executive Kai-Fu Lee (search) accused the software titan of incompetence in its plans to gain a business footing in China, and testified Tuesday that being yelled at by Chairman Bill Gates (search) was a low point of his career before he defected to rival Google Inc. (GOOG).

In testimony during a hearing on Microsoft's lawsuit against Lee and Google, Lee said he wrote a memo to another Microsoft executive saying he was "deeply disappointed at our incompetence in China — that we have wasted so many years in China with little to show for it."

Lee went on to say in the e-mail that he was embarrassed by Microsoft's business practices and that people in the government joke about Microsoft's internal politics. But he provided few details in his testimony Tuesday about what exactly the Chinese government was frustrated with.

The former executive testified that one of the lowest moments of his career with Microsoft was a conversation in which Gates yelled at him and said that the company had been "f-----" by the Chinese people and its government. Lee did not clarify the context of Gates' comments.

Google spokesman Steve Langdon said he did not know the context or date of Gates' comments, and did not know if he would be able to obtain that information. He said neither Lee nor Lee's attorney was immediately available to comment following the proceedings.

Microsoft spokeswoman Stacy Drake said she could not immediately comment on the alleged conversation between Gates and Lee.

In his testimony, Lee also complained that Microsoft had more than 20 business groups operating virtually autonomously in China, with little cohesion.

Among other problems, Lee said, was a commitment Microsoft Chief Executive Steve Ballmer (search) made in 2002 to outsource $100 million in work to China. Within the last year, after it had become clear that Microsoft wasn't fulfilling this promise, Lee said, he was put in charge of outsourcing jobs to China.

Drake said she could not confirm the numbers cited by Lee. But she confirmed that Microsoft has been outsourcing some work — such as software testing — to China and other countries, to free up its U.S. staff for other projects.

In video testimony Tuesday, Ballmer defended Microsoft's business plan in China, saying that through a process of trial and error the company had developed what he called a "secret sauce" for successful operations there.

Lee, who had worked at Microsoft beginning in 2000, joined Google in July to lead the Mountain View, Calif.-based Internet search engine company's expansion into China.

Redmond-based Microsoft has sued Google and Lee, who is known for his work on computer recognition of language, a key problem in search technology. Microsoft contends that Lee's duties at Google would violate the terms of a noncompete agreement he signed as part of his Microsoft employment contract. Microsoft also accused Lee of using insider information to get his job at Google.

Google denies the allegations and has countersued Microsoft.

Microsoft attorneys sought Tuesday's hearing before Superior Court Judge Steven Gonzalez to restrict what work Lee can do for Google until the lawsuit goes to trial in January.

In approaching Google about a job, Lee sent an e-mail stating, "I am currently the corporate vice president at Microsoft working on areas very related to Google," Microsoft's attorney, Jeff Johnson, said in opening remarks.

"He was saying, 'Look what I did at Microsoft and look what I can do for you,'" Johnson said.

In cross-examination later Tuesday, Johnson went over a timeline of Lee's last months with Microsoft, detailing the more than a dozen meetings Lee attended concerning Microsoft's business in China.

Attorneys for Google told Gonzalez that much of what Lee knew about the Chinese market came from his previous work experience at Apple Computer Inc. (AAPL) and other companies, and that Microsoft was exaggerating the extent of Lee's work for Microsoft on China.

Johnson alleged that Lee — while still on Microsoft's payroll — went so far as to send Google a paper he had written for Microsoft about the Chinese market and that he also made recommendations to Google about other people the company might want to hire.

John Keker, a lawyer for Google, argued that recruiting is not a violation of the noncompete clause because it specifies only that Lee could not take part in activities that are competitive with products, services or projects he worked on at Microsoft.

The case has illuminated the behind-the-scenes bitterness between the two rivals. Court documents released Friday said that Ballmer, in an obscenity-laced tirade over another employee having been hired away by the search company, threw a chair and vowed to "kill" Google.

Ballmer called the characterization of his response a "gross exaggeration."