Exhibit 5.1 HOGAN & HARTSON L.L.P. COLUMBIA SQUARE 555 Thirteenth Street, N.W. Washington, D.C. 20004-1109 TEL (202) 637-5600 FAX (202) 637-5910 November 20, 2002 CarrAmerica Realty Corporation CarrAmerica Realty L.P. 1850 K Street, N.W., Suite 500 Washington, D.C. 20006 Ladies and Gentlemen: We are acting as counsel to CarrAmerica Realty Corporation, a Maryland corporation (the "Company"), and CarrAmerica Realty, L.P., a Delaware limited partnership ("CARLP" and, together with the Company, the "Issuers"), in connection with the Issuers' registration statement on Form S-3 (File No. 333-53751), as amended (the "Registration Statement"), filed with the Securities and Exchange Commission relating to the proposed public offering of up to $50,000,000 aggregate principal amount of the Company's 5.261% Senior Notes due 2007 (the "Notes"). This opinion letter is furnished to you at your request to enable you to fulfill the requirements of Item 601(b)(5) of Regulation S-K, 17 C.F.R. ss. 229.601(b)(5), in connection with the Registration Statement. For purposes of this opinion letter, we have examined copies of the following documents: 1. An executed copy of the Registration Statement. 2. Executed copy of the Indenture, dated as of January 11, 2002, among the Company, CARLP (as guarantor) and U.S. Bank National Association, as trustee (the "Trustee"), as supplemented by that certain officers' certificate, dated as of November 20, 2002, issued pursuant to Section 301 of the Indenture setting forth the terms of the Notes (collectively, the "Indenture"). 3. Specimen copy of the Notes. 4. Executed copy of the Guarantee of the Notes by CARLP (the "Guarantee"). 5. Articles of Amendment and Restated of Articles of Incorporation of the Company, as amended, as certified by the State Department of Assessments and Taxation of the State of Maryland on November 12, 2002, and as certified by the Secretary of the Company on the date hereof as being complete, accurate and in effect. 6. Second Amendment and Restatement of the Company's By-Laws, as amended, as certified by the Secretary of the Company on the date hereof as being complete, accurate and in effect. 7. Certificate of Limited Partnership of CARLP, as amended, as certified by the Secretary of State of the State of Delaware on November 8, 2002, and as certified by the Secretary of CarrAmerica Realty GP Holdings, Inc. ("GP Holdings"), the general partner of CARLP, on the date hereof as being complete, accurate and in effect. 8. Third Amended and Restated Agreement of Limited Partnership of CARLP, as amended, as certified by the Secretary of GP Holdings on the date hereof as being complete, accurate and in effect. 9. Certificate of Incorporation of GP Holdings, as certified by the Secretary of State of the State of Delaware on November 8, 2002, and as certified by the Secretary of GP Holdings on the date hereof as being complete, accurate and in effect. 10. By-Laws of GP Holdings, as certified by the Secretary of GP Holdings on the date hereof as being complete, accurate and in effect. 11. Executed copy of the Underwriting Agreement, dated as of January 8, 2002 (the "Underwriting Agreement"), by and among the Company and J.P. Morgan Securities Inc. ("J.P. Morgan"). 12. Executed copy of the Terms Agreement, dated as of November 15, 2002, by and among the Company, CARLP, as guarantor, Banc of America Securities LLC, J.P. Morgan, Fleet Securities, Inc., HSBC Securities (USA) Inc. and Wachovia Securities, Inc., which incorporates by reference the Underwriting Agreement in its entirety, relating to the sale of the Notes. 13. Certain resolutions of the Board of Directors of the Company adopted at meetings held on April 15, 1998 and November 7, 2002, and of the Pricing Committee of the Board of Directors of the Company adopted by unanimous consent dated November 15, 2002, relating to the sale and authorization of the Notes by the Company and arrangements in connection therewith, as certified by the Secretary of the Company on the date hereof as being complete, accurate and in effect. 14. Certain resolutions of the Board of Directors of GP Holdings adopted by unanimous consent dated November 15, 2002, relating to the authorization of the Guarantee and arrangements in connection therewith, as certified by the Secretary of GP Holdings on the date hereof as being complete, accurate and in effect. In our examination of the aforesaid documents, we have assumed the genuineness of all signatures, the legal capacity of all natural persons, the accuracy and completeness of all documents submitted to us, the authenticity of all original documents, and the conformity to authentic original documents of all documents submitted to us as copies (including telecopies). This opinion letter is given, and all statements herein are made, in the context of the foregoing. For the purposes of this opinion letter, we have assumed that (i) the Trustee has all requisite power and authority under all applicable laws, regulations and governing documents to execute, deliver and perform its obligations under the Indenture, (ii) the Trustee has duly authorized, executed and delivered the Indenture, (iii) the Trustee is validly existing and in good standing in all necessary jurisdictions, (iv) the Indenture constitutes a valid and binding obligation, enforceable against the Trustee in accordance with its terms, and (v) there has been no material mutual mistake of fact or misunderstanding or fraud, duress or undue influence, in connection with the negotiation, execution or delivery of the Indenture. This opinion letter is based as to matters of law solely on (i) the Maryland General Corporation Law, as amended, (ii) the Delaware Revised Uniform Limited Partnership Act, as amended, and (iii) New York contract law (but not including any statutes, ordinances, administrative decisions, rules or regulations of any political subdivision of the State of New York). We express no opinion herein as to any other laws, statutes, ordinances, rules or regulations. As used herein, the term (i) "Maryland General Corporation Law, as amended," includes the statutory provisions contained therein, all applicable provisions of the Maryland Constitution and reported judicial decisions interpreting these laws and (ii) "Delaware Revised Uniform Limited Partnership Act, as amended," includes the statutory provisions contained therein, all applicable provisions of the Delaware Constitution and reported judicial decisions interpreting these laws. Based upon, subject to and limited by the foregoing, assuming due execution and delivery of the Notes and the Indenture, we are of the opinion that, following execution, authentication and delivery of the Notes and the Guarantee in accordance with the Indenture, the Notes will be binding obligations of the Company, and the Guarantee will be a binding obligation of CARLP, both enforceable in accordance with their terms. The opinion expressed above with respect to the enforceability of the Notes and the Guarantee, respectively, (i) are each subject to the exception that enforceability may be limited by (a) bankruptcy, insolvency, reorganization, moratorium or other laws affecting creditors' rights (including, without limitation, the effect of statutory and other law regarding fraudulent conveyances, fraudulent transfer and preferential transfers), and (b) the exercise of judicial discretion and the application of principles of equity including, without limitation, requirements of good faith, fair dealing, conscionability and materiality (regardless of whether such agreement is considered in a proceeding in equity or at law) and (ii) shall be understood to mean only that if there is a default in performance of an obligation, (a) if a failure to pay or other damage can be shown and (b) if the defaulting party can be brought into a court which will hear the case and apply the governing law, then, subject to the availability of defenses, and to the exceptions set forth in the immediately preceding clause (i), the court will provide a money damage (or perhaps an injunctive or specific performance) remedy. This opinion letter has been prepared for your use in connection with the Registration Statement and speaks as of the date hereof. We assume no obligation to advise you of any changes in the foregoing subsequent to the delivery of this opinion letter. * * * * * We hereby consent to the filing of this opinion letter as Exhibit 5.1 to the Registration Statement and to the reference to this firm under the caption "Legal Matters" in the Prospectus Supplement dated November 15, 2002 constituting a part of the Registration Statement. In giving this consent, we do not thereby admit that we are an "expert" within the meaning of the Securities Act of 1933, as amended. Very truly yours, /s/ HOGAN & HARTSON L.L.P. HOGAN & HARTSON L.L.P.