Exhibit 5.1

[Letterhead of Davis Polk & Wardwell]

April 28, 2008

KLA-Tencor Corporation

One Technology Drive

Milpitas, California 95035

Dear Ladies and Gentlemen:

We have acted as counsel for KLA-Tencor Corporation, a Delaware corporation (the “Company”), in connection with the Company’s Registration Statement on Form S-3 (the “Registration Statement”) filed on the date hereof with the Securities and Exchange Commission pursuant to the Securities Act of 1933, as amended (the “Securities Act”), for the registration of the sale from time of time of Senior Notes of the Company (the “Notes”).

The Notes are to be issued pursuant to an indenture to be entered into on the date of issuance of the Notes (“Indenture”) by the Company and Wells Fargo Bank, N.A., as trustee, substantially in the form filed as Exhibit 4.1 to the Registration Statement. Certain terms of the Notes will be approved by the Board of Directors of the Company or a committee thereof or certain authorized officers of the Company as part of the corporate action taken and to be taken in connection with the issuance of the Notes. The Notes are to be issued in an underwritten public offering pursuant to an underwriting agreement (the “Underwriting Agreement”) to be entered into by the Company and Merrill Lynch, Pierce, Fenner & Smith Incorporated and the other underwriters named therein (together, the “Underwriters”).

We, as your counsel, have examined originals or copies, certified or otherwise identified to our satisfaction, of such documents, corporate records, certificates of public officials and other instruments and such matters of fact and law that we have deemed necessary for the purposes of rendering this opinion.

On the basis of the foregoing, we advise you that, in our opinion, when the Indenture has been duly authorized, executed and delivered by the trustee and the Company, the terms of the Notes have been duly authorized and established in accordance with the Indenture and the Notes have been duly executed, authenticated, issued and delivered to and paid for by the Underwriters in accordance with the Underwriting Agreement and the Indenture, the Notes will constitute valid and binding obligations of the Company, enforceable in accordance with their terms, subject to applicable bankruptcy, insolvency and similar laws affecting creditors’ rights generally and equitable principles of general applicability.

In connection with the opinion expressed above, we have assumed that, at or prior to the time of the delivery of the Notes, (i) the Board of Directors of the Company, a committee thereof or authorized officers of the Company shall have duly established the terms of the Notes and duly authorized the issuance and sale of the Notes and such authorization shall not have been modified or rescinded and (ii) the Registration Statement shall have become effective and such effectiveness shall not have been terminated or rescinded. We have also assumed that none of the terms of the Notes to be established subsequent to the date hereof, nor the issuance and delivery of the Notes, nor the compliance by the Company with the terms of the Notes will violate any applicable law or will result in a violation of any provision of any instrument or agreement then binding upon the Company, or any restriction imposed by any court or governmental body having jurisdiction over the Company.

In providing the opinions set forth above, we express no opinion as to (a) the validity, binding nature or enforceability of any provision of the Notes or the Indenture that requires or relates to payment of any premium in an amount that a court determines under the circumstances under applicable law to be commercially unreasonable, a penalty or a forfeiture or (b) the validity, binding nature or enforceability of any provision of the Notes or the Indenture that permits holders to collect any portion of stated principal amount upon acceleration of the Notes to the extent determined to constitute unearned interest.


We are members of the Bars of the States of New York and California and the foregoing opinion is limited to the laws of the State of New York and the General Corporation Law of the State of Delaware (including the statutory provisions, all applicable provisions of the Delaware Constitution and reported judicial decisions interpreting the foregoing).

We hereby consent to the filing of this opinion as an exhibit to the Registration Statement referred to above and further consent to the use of our name under the caption “Legal Matters” in the prospectus, which is a part of the Registration Statement. In giving this consent, we do not admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act.

This opinion is rendered solely to you in connection with the above matter. This opinion may not be relied upon by you for any other purpose or relied upon by or furnished to any other person without our prior written consent.

Very truly yours,

/s/    DAVIS POLK & WARDWELL