QuickLinks -- Click here to rapidly navigate through this document

EXHIBIT 5


OPINION AND CONSENT OF MORGAN, LEWIS & BOCKIUS LLP

January 6, 2004

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

Dear 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 registration on Form S-8 (the "Registration Statement") under the Securities Act of 1933, as amended, of 166,600 Common Shares of beneficial interest of the Company (the "Shares") for issuance under the Corporate Office Properties, L.P. Employee Retirement Savings Plan (the "Plan").

        This opinion is being furnished in accordance with the requirements of Item 8 of Form S-8 and Item 601(b)(5)(i) of Regulation S-K.

        We have reviewed the corporate proceedings taken by the Company and Corporate Office Properties, L.P. in connection with the amendment of the Plan that resulted in the establishment and implementation of a Company share fund as an investment option under the Plan. Based on such review, we are of the opinion that, if, as and when the Shares have been issued and sold (and the consideration therefor received) pursuant to the provisions of the Plan and in accordance with the Registration Statement, such Shares will be duly authorized, legally issued, fully paid and nonassessable.

        We consent to your filing this letter as an exhibit to the Registration Statement. In giving the opinion set forth in this letter, we do not hereby admit that we are acting within the category of persons whose consent is required under Section 7 of the Securities Act of 1933, as amended, or the rules or regulations of the Securities and Exchange Commission thereunder.

        This opinion letter is rendered as of the date first written above and we disclaim any obligation to advise you of facts, circumstances, events or developments which hereafter may be brought to our attention and which may alter, affect or modify the opinion expressed herein. Our opinion is expressly limited to the matters set forth above and we render no opinion, whether by implication or otherwise, as to any other matters relating to the Company, the Plan or the Shares.

    Very truly yours,

 

 

/s/ Morgan, Lewis & Bockius LLP

 

 

MORGAN, LEWIS & BOCKIUS LLP



QuickLinks

OPINION AND CONSENT OF MORGAN, LEWIS & BOCKIUS LLP