EXHIBIT 5.1

OPINION OF BRIAN M. MARTIN, ESQ.

[KLA-Tencor Corporation letterhead]

November 15, 2007

KLA-Tencor Corporation

One Technology Drive

Milpitas, California 95035

 

Re: Registration Statement on Form S-8

Ladies and Gentlemen:

KLA-Tencor Corporation, a Delaware corporation (the “Company”), is filing with the Securities and Exchange Commission a Registration Statement on Form S-8 (the “Registration Statement”) for the purpose of registering under the Securities Act of 1933, as amended (the “Securities Act”), up to $75,000,000 of deferred compensation obligations (the “Deferred Compensation Obligations”) of the Company pursuant to the Company’s Executive Deferred Savings Plan (the “Plan”).

I have acted as General Counsel to the Company with respect to the issuance of this opinion and, as such counsel, have examined such documents and such matters of fact and law that I have deemed relevant and necessary as the basis for the opinions hereinafter expressed. In such examinations, I have assumed the genuineness of all signatures and the authenticity of all documents submitted to me as originals and the conformity to original documents of all documents submitted to me as conformed or photostatic copies.

Based on the foregoing, I am of the opinion that, when issued in accordance with the terms of the Plan, the Deferred Compensation Obligations will be legally and validly issued and will constitute binding obligations of the Company, enforceable in accordance with their terms, except as enforcement thereof may be limited by bankruptcy, insolvency or other laws of general applicability relating to or affecting enforcement of creditors’ rights or by general principles of equity.

I hereby consent to the filing of this opinion as an Exhibit to the Registration Statement.

 

Sincerely,
/s/ BRIAN M. MARTIN

Brian M. Martin

Senior Vice President and General Counsel

KLA-Tencor Corporation