QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

Morgan Lewis
Counselors at Law

Morgan, Lewis & Bockius LLP
1701 Market Street
Philadelphia, PA 19103-2921
Tel 215.963.5000
Fax: 215.963.5001
www.morganlewis.com

August 10, 2004

Corporate Office Properties Trust
8815 Centre Park Drive
Suite 400
Columbia, Maryland 21045

RE:
Corporate Office Properties Trust—Registration Statement on Form S-8

Ladies and Gentlemen:

        We have acted as counsel to Corporate Office Properties Trust, a Maryland real estate investment trust (the "Company"), in connection with the filing of the referenced Registration Statement on Form S-8 (the "Registration Statement") under the Securities Act of 1933, as amended (the "Act"), with the Securities and Exchange Commission (the "SEC"). The Registration Statement relates to the proposed offering and sale of up to 2,648,245 of the Company's common shares of beneficial interest, par value $0.01 per share (the "Shares"), which may be issued under the Company's 1998 Long Term Incentive Plan (the "Plan").

        In connection with this opinion letter, we have examined the Plan, the Registration Statement and originals, or copies certified or otherwise identified to our satisfaction, of the Amended and Restated Declaration of Trust, as amended and supplemented, and Bylaws of the Company and such other documents, records and other instruments as we have deemed appropriate for purposes of the opinion set forth herein. As to matters of fact, we have relied on representations of officers of the Company.

        We have assumed the genuineness of all signatures, the legal capacity of all natural persons, the authenticity of the documents submitted to us as originals, the conformity with the originals of all documents submitted to us as certified, facsimile or photostatic copies and the authenticity of the originals of all documents submitted to us as copies.

        Based upon the foregoing, we are of the opinion that the Shares have been duly authorized by the Company and, when issued and sold by the Company in the manner contemplated by the Registration Statement and in accordance with the terms and conditions of the Plan, will be validly issued, fully paid and non-assessable.

        The opinions expressed herein are limited to the laws of the State of Maryland.

        We hereby consent to the use of this opinion as Exhibit 5.1 to the Registration Statement. In giving such consent, we do not hereby admit that we are acting within the category of persons whose consent is required under Section 7 of the Act or the rules or regulations of the SEC thereunder.

Very truly yours,

/s/ MORGAN, LEWIS & BOCKIUS, LLP




QuickLinks