MOUNTAIN VIEW — Google, in seeking to improve its workforce diversity, imposed illegal hiring quotas favoring women, blacks and Latinos and discriminating against white and Asian men, a former employee claims in a lawsuit.

Former Google recruiter Arne Wilberg, who worked in the company’s YouTube division, also alleges that the Mountain View tech giant systematically discriminated against older engineers in its hiring and sought to purge internal correspondence about its illegal employment practices.

Google fired him for complaining about the company’s hiring, though he was “an exemplary employee,” according to the lawsuit filed in San Mateo County Superior Court.

“For the past several years, Google has had and implemented clear and irrefutable policies, memorialized in writing and consistently implemented in practice, of systematically discriminating in favor (of) job applicants who are Hispanic, African American, or female, and against Caucasian and Asian men,” according to the suit.

“The stated purpose of these policies was to achieve ‘Diversity’ in the Google workforce and to manage public relations problems arising from the under-representation of women and certain minority groups in the Google workforce, particularly in engineering positions.”

Google, the first major Silicon Valley tech firm to publicly disclose its diversity statistics, said in a statement it would fight the lawsuit vigorously.

“We have a clear policy to hire candidates based on their merit, not their identity,” the company said Thursday. “At the same time, we unapologetically try to find a diverse pool of qualified candidates for open roles, as this helps us hire the best people, improve our culture, and build better products.”

According to Google’s own statistics, the company’s U.S. workforce is 56 percent white, 35 percent Asian and 69 percent male.

Wilberg’s suit, filed Jan. 29, states that he worked for seven years at Google, including time on the team for tech staffing at YouTube, the company’s video-streaming unit.

Wilberg filed with his lawsuit copies of two purported emails from a woman identified as the YouTube staffing team manager, in which she is alleged to have directed hiring team members to only consider and accept candidates from “under-represented groups.”

In April 2017, Google’s “technology staffing management team” was told to cancel job interviews for software engineers with five or fewer years of experience who were not female, black or Latino, and to “purge entirely any applications by non-diverse employees from the hiring pipeline,” according to the suit.

Wilberg also claims that Google “policy documents” directed the firm’s YouTube recruiters to hire only “diverse” people for the third quarter of 2017. And he alleges that internal documents known as “weekly recaps” show Google had set hiring targets for women, blacks and Latinos.

He claims he “repeatedly opposed these illegal and discriminatory

hiring practices by complaining to his managers and HR,” telling them “it was illegal to have such hiring quotas favoring certain groups based on race and gender.”

In response to Wilberg’s complaints and warnings Google would occasionally circulate e-mails instructing its employees (to) purge any and all references to the race/gender quotas from its e-mail database … to wipe out any paper trail of Google’s illegal practices,” according to his lawsuit.

The company also “had a practice of systematically discriminating against older engineers in its hiring practices,” according to the suit. In one case, the suit claims, hiring managers pressured Wilberg to make an applicant over 40 apply for a position he wasn’t qualified for so the job seeker would fail to gain employment at Google.

Wilberg is seeking a jury trial and unspecified damages.