
<PAGE>

                                                                     Exhibit 5.1



                                                 June 5, 1998



Brandywine Realty Trust
Brandywine Operating Partnership, L.P.
16 Campus Boulevard
Newtown Square, Pennsylvania 19073

                  Re:      Registration Statement on Form S-3

Ladies and Gentlemen:

                  We have acted as counsel to Brandywine Realty Trust, a
Maryland real estate investment trust (the "Company"), and Brandywine Operating
Partnership, L.P., a Delaware limited partnership (the "Partnership"), in
connection with the registration of (i) the following securities of the Company
having an aggregate initial offering price of up to $633,129,026: (a) common
shares of beneficial interest, $.01 par value per share ("Common Shares"), (b)
one or more series of preferred shares of beneficial interest, $.01 par value
per share ("Preferred Shares"), (c) one or more series of Preferred Shares
represented by depositary shares ("Depositary Shares") and (d) warrants to
purchase Common Shares, Preferred Shares or Depositary Shares (the "Warrants")
and (ii) up to $750,000,000 aggregate initial offering price of debt securities
by the Partnership ("Debt Securities"), which may be guaranteed by unconditional
and irrevocable guarantees thereof by the Company ("Guarantees"), (collectively,
the "Securities"), covered by the above-referenced Registration Statement, and
all amendments thereto (the "Registration Statement"), under the Securities Act
of 1933, as amended (the "1933 Act"). Unless otherwise defined herein,
capitalized terms used herein shall have the meanings assigned to them in the
Registration Statement.

                  The issuance of, and certain terms of, the Securities to be
issued by the Company and the Partnership from time to time will be approved by
the Board of Trustees of the Company or a committee thereof (acting on behalf of
the Company in its own capacity and in its capacity as general partner of the
Partnership) as part of the trust action taken and to be taken in connection
with the authorization of the issuance of the Securities (the "Trust
Proceedings").

                  In connection with our representation of the Company and the
Partnership, and as a basis for the opinion hereinafter set forth, we have
examined originals, or copies certified or otherwise identified to our
satisfaction, of the following documents (collectively, the "Documents"):

                  1.  The Registration Statement and the related form of
prospectus included therein in the form in which it was transmitted to the
Securities and Exchange Commission under the 1933 Act, on the date hereof;

                  2.  The Amended and Restated Declaration of Trust of the
Company, as amended (the "Declaration"), certified as of a recent date by the
State Department of Assessments and Taxation of Maryland (the "SDAT");

                  3.  The Bylaws of the Company;

                  4.  The Certificate of Limited Partnership of the Partnership
(the "Certificate"), certified as of a recent date by the Secretary of State of
the State of Delaware (the "SSSD");

<PAGE>


                  5.  The Amended and Restated Agreement of Limited Partnership
of the Partnership, as amended as of the date hereof (the "Partnership
Agreement");

                  6.  Resolutions adopted by the Board of Trustees of the
Company (acting on behalf of the Company in its own capacity and its capacity 
as general partner of the Partnership) relating to the sale, issuance and 
registration of the Securities;

                  7.  The form of certificate evidencing Common Shares;

                  8.  A certificate of the SDAT as to the good standing of the 
Company, dated as of a recent date;

                  9.  A certificate of the SSSD as to the good standing of the
Partnership, dated as of a recent date; and

                  10. Such other documents and matters as we have deemed
necessary or appropriate to express the opinion set forth in this letter,
subject to the assumptions, limitations and qualifications stated herein.
Insofar as this opinion relates to matters of Maryland law, we have relied
exclusively upon the opinion of Ballard Spahr Andrews & Ingersoll, LLP addressed
to the Company, dated as of the date hereof.

                  In expressing the opinion set forth below, we have assumed,
and so far as is known to us there are no facts inconsistent with, the
following:

                  1.  Each individual executing any of the Documents, whether on
behalf of such individual or another person, is legally competent to do so.

                  2.  Each individual executing any of the Documents on behalf 
of a party (other than the Company or the Partnership) is duly authorized to 
do so.

                  3.  Each of the parties (other than the Company or the
Partnership) executing any of the Documents has duly and validly executed and
delivered each of the Documents to which such party is a signatory, and such
party's obligations set forth therein are legal, valid and binding.

                  4.  All Documents submitted to us as originals are authentic.
All Documents submitted to us as certified or photostatic copies conform to the
original documents. All signatures on all such Documents are genuine. All public
records reviewed or relied upon by us or on our behalf are true and complete.
All statements and information contained in the Documents are true and complete.
There are no oral or written modifications or amendments to the Documents, by
action or conduct of the parties or otherwise.

                  5.  Securities will be issued against payment of valid
consideration under applicable law.

                  6.  The outstanding shares of beneficial interest of the
Company have not been and will not be transferred in violation of any
restriction or limitation contained in the Declaration. The Securities will not
be transferred in violation of any restriction or limitation contained in the
Declaration.

                  In expressing the opinion set forth below, we have further
assumed that the classification, terms and conditions, amount, issuance and sale
of the Securities to be offered from time to time will be duly authorized and
determined by proper action by the Board of Trustees or a committee thereof
(acting on behalf of the Company in its own capacity and its capacity as general
partner of the Partnership) consistent with the procedures and terms described
in the Registration Statement and in accordance with the Declaration, the
Certificate, the Partnership Agreement and applicable Maryland and Delaware law.
We further assume that prior to any issuance of Preferred Shares or Depositary
Shares, appropriate Articles Supplementary to the Declaration shall be duly
filed for



<PAGE>



recordation with the Maryland State Department of Assessments and Taxation. We
further assume that (i) any Depositary Shares will be issued by a depositary (as
defined below) under one or more deposit agreements (each, a "Deposit
Agreement"), each between the Company and a financial institution identified
therein as depositary (each, a "Depositary") and (ii) any Debt Securities will
be issued pursuant to an indenture (an "Indenture") between the Operating
Partnership, the Company (if such Debt Securities are the subject of Guarantees)
and a trustee for the benefit of the holders of the Debt Securities. The phrase
"known to us" is limited to the actual knowledge, without independent inquiry,
of the lawyers at our firm who have performed legal services in connection with
the issuance of this opinion.

                  Based upon the foregoing, and subject to the assumptions,
limitations and qualifications stated herein, we are of the opinion that:

                  1. Upon the completion of all Trust Proceedings relating to
the Securities that are Common Shares (the "Common Securities") and the due
execution, countersignature and delivery of certificates evidencing the Common
Securities and assuming that the sum of (a) all Common Shares issued as of the
date hereof, (b) any Common Shares issued between the date hereof and the date
on which any of the Common Securities are actually issued (not including any of
the Common Securities), and (c) the Common Securities will not exceed the total
number of Common Shares that the Company is then authorized to issue, the Common
Securities will be duly authorized and, when and if delivered against payment
therefor in accordance with the resolutions of the Board of Trustees of the
Company authorizing their issuance, will be validly issued, fully paid and
nonassessable.

                  2. Upon the completion of all Trust Proceedings relating to
the Securities that are Preferred Shares (the "Preferred Securities"), and upon
classification of Preferred Securities in accordance with applicable law and the
filing of appropriate Articles Supplementary to the Declaration and the due
execution, countersignature and delivery of certificates evidencing the
Preferred Securities and assuming that the sum of (a) all Preferred Shares
issued as of the date hereof, (b) any Preferred Shares issued between the date
hereof and the date on which any of the Preferred Securities are actually issued
(not including any of the Preferred Securities), and (c) the Preferred
Securities will not exceed the total number of Preferred Shares that the Company
is then authorized to issue, the Preferred Securities will be duly authorized
and, when and if delivered against payment therefor in accordance with the
resolutions of the Board of Trustees of the Company authorizing their issuance,
will be validly issued, fully paid and nonassessable.

                  3. Upon completion of all Trust Proceedings relating to
Securities that are Warrants and the due execution, authentication and delivery
of certificates representing such Warrants (and assuming that the sum of (a) any
Common Shares or Preferred Shares, as applicable, issued as of the date hereof,
(b) any Common Shares or Preferred Shares, as applicable, issued between the
date hereof and the date on which the Warrants are actually issued or exercised
and (c) the number of Common Shares or Preferred Shares, as applicable, issuable
upon exercise of such Warrants will not exceed the total number of Common Shares
or Preferred Shares, as applicable, that the Company is authorized to issue, the
Warrants, if governed by the laws of the Commonwealth of Pennsylvania, will be
duly authorized and will be binding obligations of the Company enforceable
against the Company in accordance with their respective terms, except as such
enforceability may be limited by bankruptcy, insolvency, reorganization or
similar laws affecting creditors' rights generally and subject to general
principles of equity.

                  The Warrants will be issued under one or more warrant
agreements (each, a "Warrant Agreement"), each between the Company and a
financial institution identified therein as a warrant agent (the "Warrant
Agent"). To the extent that the obligations of the Company under each Warrant
Agreement may be dependent upon such matters, we assume for purposes of this
opinion that the Warrant Agent will be duly organized, validly existing and in
good standing under the laws of its jurisdiction of organization; that the
Warrant Agent will be duly qualified to engage in the activities contemplated by
the Warrant Agreement; that the Warrant Agreement will be duly authorized,
executed and delivered by the Warrant Agent and will constitute the legal, valid
and binding obligation of the Warrant Agent enforceable against the Warrant
Agent in accordance with its terms; that the Warrant Agent will be in
compliance, generally with respect to acting as a Warrant Agent under the
Warrant



<PAGE>



Agreement, with all applicable laws and regulations; and that the Warrant Agent
will have the requisite organizational and legal power and authority to perform
its obligations under the Warrant Agreement.

                  4. Upon the completion of all Trust Proceedings relating to a
Deposit Agreement and a series of Preferred Securities underlying a series of
Depositary Shares (and subject to the assumption expressed in paragraph 2
above), and upon the classification of such Preferred Securities in accordance
with applicable law and the filing of appropriate Articles Supplementary to the
Declaration and the due execution, countersignature and delivery of certificates
evidencing the Preferred Shares and depositary receipts evidencing the
Depositary Shares (the "Depositary Receipts") in the form provided by a Deposit
Agreement, such Depositary Shares will be validly issued and will entitle the
holders thereof to the rights specified in the Depositary Receipts and the
Deposit Agreement for such Depositary Shares.

                  5. Upon completion of all Trust Proceedings relating to
Securities that are Debt Securities and Guarantees, and upon the due execution
and delivery of the Debt Securities pursuant to an Indenture, the Debt
Securities will be duly authorized by all necessary partnership action of the
Partnership and the Guarantees will be duly authorized by all necessary trust
action of the Company and such Debt Securities and Guarantees will be legally
issued and will be binding obligations of the Partnership and the Company,
respectively.

                  We assume no obligation to supplement this opinion if any
applicable law changes after the date hereof or if we become aware of any fact
that might change the opinion expressed herein after the date hereof.

                  We hereby consent to the reference to our firm under the
Section "Legal Matters" in the Prospectus included in the Registration Statement
and to the filing of this opinion as an exhibit to the Registration Statement.
In giving this consent, we do not admit that we are within the category of
persons whose consent is required by Section 7 of the 1933 Act.

                                                 Very truly yours,

                       
                                                 /s/ Pepper Hamilton LLP
                                                 -------------------------------
                                                 PEPPER HAMILTON LLP
