QuickLinks -- Click here to rapidly navigate through this documentExhibit 5.1
[Letterhead of Covington & Burling]
June 28, 2004
Kerr-McGee Corporation
123 Robert S. Kerr Avenue
Oklahoma City, Oklahoma 73102
Ladies and Gentlemen:
We are acting as counsel to Kerr-McGee Corporation, a Delaware corporation (the "Company"), in connection with the registration under the Securities Act of 1933, as amended (the "Act"), of 1,893,996 shares of common stock, par value $1.00 per share (the "Shares"), of the Company issuable upon the exercise of stock options granted pursuant to the Westport Resources Corporation 2000 Stock Incentive Plan, the Westport Resources Corporation 2000 Directors' Stock Option Plan, the Westport Resources Corporation 2000 Stock Option Plan, the Belco Oil & Gas Corp. 1996 Non-Employee Directors' Stock Option Plan and the Belco Oil & Gas Corp. 1996 Stock Incentive Plan (the "Plans").
We have reviewed such corporate records, certificates and other documents, and such questions of law, as we have deemed necessary or appropriate for the purposes of this opinion. We have assumed that all signatures are genuine, that all documents submitted to us as originals are authentic and that all copies of documents submitted to us conform to the originals thereof.
We have relied as to certain matters on information obtained from public officials, officers of the Company and other sources believed by us to be responsible.
Based upon the foregoing, we are of the opinion that the Shares have been duly authorized and reserved for issuance pursuant to the Plans, and when the Shares have been duly issued upon the exercise of stock options pursuant to the Plans, and assuming compliance with the Act, the Shares will be validly issued, fully paid and nonassessable.
We are members of the bar of the State of New York. We do not purport to be experts in, and do not express any opinion on, any laws other than the law of the State of New York, the Delaware General Corporation Law, including all applicable provisions of the Delaware Constitution and reported Judicial decisions interpreting such laws, and the Federal law of the United States of America.
We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement. In giving such consent, we do not thereby admit that we are in the category of persons whose consent is required under Section 7 of the Act.
| | Very truly yours, |
| | |
| | /s/ Covington & Burling |
QuickLinks
[Letterhead of Covington & Burling]