QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

June 7, 2013

Corporate Office Properties Trust
Corporate Office Properties, L.P.
6711 Columbia Gateway Drive
Suite 300
Columbia, Maryland 21046

Re:
Registration Statement on Form S-4; Exchange Offer for $350,000,000 aggregate principal amount of 3.600% Senior Notes Due 2023 of Corporate Office Properties, L.P.

Ladies and Gentlemen:

        We have acted as counsel for Corporate Office Properties, L.P., a Delaware limited partnership (the "Operating Partnership"), and Corporate Office Properties Trust, a Maryland real estate investment trust (the "Company"), in connection with the issuance of $350,000,000 aggregate principal amount of 3.600% Senior Notes Due 2023 (the "Exchange Notes") of the Operating Partnership and the guarantees of the Exchange Notes by the Company (the "Guarantees"), under an Indenture, dated May 6, 2013 (the "Indenture"), among the Operating Partnership, as issuer, the Company, as guarantor, and U.S. Bank National Association, as trustee (the "Trustee"), and pursuant to a registration statement on Form S-4 under the Securities Act of 1933, as amended (the "Act"), filed with the Securities and Exchange Commission (the "Commission") on the date hereof (the "Registration Statement"). The Exchange Notes and the Guarantees will be issued in exchange for the Operating Partnership's outstanding 3.600% Senior Notes due 2023 (the "Private Notes") on the terms set forth in the prospectus contained in the Registration Statement (the "Prospectus"). This opinion is being furnished in connection with the requirements of Item 601(b)(5) of Regulation S-K under the Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement or Prospectus, other than as expressly stated herein with respect to the issue of the Exchange Notes and Guarantees.

        In connection with the opinions expressed below, we have examined originals or copies (certified or otherwise identified to our satisfaction) of (i) the Indenture, (ii) the forms of Exchange Notes and Private Notes, (iii) the form of Guarantees, and (iv) such other documents and records as we have deemed appropriate for the purposes of the opinions set forth herein.

        We have assumed the genuineness of all signatures, the legal capacity of natural persons, the authenticity of the documents submitted to us as originals, the conformity to the original documents 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.

        As to any facts that are material to the opinions hereinafter expressed that we did not independently establish or verify, we have relied without investigation upon certificates and other assurances of officers of the Operating Partnership and the Company.

        Based upon and subject to the foregoing and to the limitations and qualifications described below, we are of the opinion that:


        The foregoing opinions are expressly limited to the laws of the United States, the Commonwealth of Pennsylvania, the State of New York and the Revised Uniform Limited Partnership Act of the State of Delaware and the General Corporation Law of the State of Delaware.

        This opinion letter is effective only as of the date hereof. We do not assume responsibility for updating this opinion letter as of any date subsequent to its date, and we assume no responsibility for advising you of any changes with respect to any matters described in this opinion letter that may occur, or facts that may come to our attention, subsequent to the date hereof.

        With your consent, we have assumed (a) that the Indenture has been duly authorized, executed and delivered by the parties thereto, (b) the Private Notes, the Exchange Notes and the Guarantees (collectively, along with the Indenture, the "Documents") have been duly authorized, executed and delivered by the parties thereto other than the Operating Partnership, (c) that the Indenture constitutes legally valid and binding obligations of the Trustee, enforceable against the Trustee in accordance with its terms, and (d) that the status of the Documents as legally valid and binding obligations of the parties is not affected by any (i) breaches of, or defaults under, agreements or instruments, (ii) violations of statutes, rules, regulations or court or governmental orders or (iii) failures to obtain required consents, approvals or authorizations from, or make required registrations, declarations or filings with, governmental authorities.

        This opinion letter is furnished by us solely for your benefit in connection with the Registration Statement and may be relied upon by you and by persons entitled to rely upon it pursuant to the applicable provisions of the Act. We consent to your filing this opinion as an exhibit to the Registration Statement and to the reference to our firm contained in the Prospectus under the heading "Legal Matters." 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 or the rules and regulations of the Commission thereunder.

        This opinion letter is not to be quoted in whole or in part or otherwise referred to or used, nor is it to be filed with any governmental agency or any other person, without our express written consent.

Very truly yours,

Morgan, Lewis and Bockius LLP

2




QuickLinks