<Page>

                                                                       Exhibit 5

Morgan, Lewis & Bockius LLP
Counselors at Law

1701 Market Street
Philadelphia, PA 19103-2921
215-963-5000
Fax: 215-963-5299


                                 May 1, 2002

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 proposed
filing with the Securities and Exchange Commission (the "Commission") under
the Securities Act of 1933, as amended (the "Securities Act"), of a
Registration Statement on Form S-8 (the "Registration Statement") for the
purpose of registering (i) $10,000,000 of Deferred Compensation Obligations,
which represent unsecured obligations of the Company to pay deferred
compensation in accordance with the terms of the Corporate Office Properties
Trust Supplemental Nonqualified Deferred Compensation Plan (the "Plan") and
(ii) such indeterminate number of the common shares of beneficial interest,
$0.01 par value, of the Company (the "Common Shares") as may be issuable upon
redemption of the Deferred Compensation Obligations in accordance with the
Plan. We have examined such records and have made such examination of law as
we deem appropriate in connection with our opinions expressed in this letter.
In our examination, we have assumed the genuineness of all signatures, the
authenticity of all documents submitted to us as originals and the conformity
with the originals of all documents submitted to us as copies thereof.

Based upon the foregoing, we advise you that, in our opinion, (i) when issued in
accordance with the provisions of the Plan, the Deferred Compensation
Obligations will be valid and binding obligations of the Company, enforceable
against the Company 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 general equity
principles, and (ii) when, as and if the Deferred Compensation Obligations have
been redeemed for Common Shares and such Common


<Page>

Shares have been issued and delivered in accordance with the terms of the Plan,
such Common Shares will be validly issued, fully paid and nonassessable.


The opinion set forth above is limited to the laws of the State of Maryland.


We consent to the filing of this opinion as an Exhibit to 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 or the
rules and regulations of the Commission thereunder.


Very truly yours,

/s/ Morgan, Lewis & Bockius LLP