Form: S-3

Registration statement for specified transactions by certain issuers

July 28, 2003


QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

[Goodwin Procter Letterhead]

July 28, 2003

AvalonBay Communities, Inc.
2900 Eisenhower Avenue, Suite 300
Alexandria, VA 22314

    Re:
    Legality of Securities to be Registered
    under Registration Statement on Form S-3

Ladies and Gentlemen:

        This opinion is delivered in our capacity as counsel to AvalonBay Communities, Inc., a Maryland corporation (the "Company"), in connection with the Company's registration on Form S-3 (the "Registration Statement") filed with the Securities and Exchange Commission under the Securities Act of 1933, as amended (the "Securities Act"), of up to an aggregate of 469,114 shares (the "Shares") of common stock, par value $.01 per share ("Common Stock"), that may be offered and sold from time to time by the holders of units of limited partnership interest in Avalon DownREIT V, L.P., Avalon Ballston II, L.P., Avalon Grosvenor, L.P. and/or Avalon Upper Falls, L.P. (the "Operating Partnerships") to the extent that such holders tender those units (the "Tendered Units") to the applicable Operating Partnership for redemption and the Company exercises its right to issue shares of Common Stock in lieu of cash for the Tendered Units.

        We have examined the Amended and Restated Articles of Incorporation of the Company, as amended and on file with the Maryland State Department of Assessments and Taxation, the Amended and Restated Bylaws of the Company, such records of corporate proceedings of the Company as we have deemed appropriate for the purposes of this opinion, the Registration Statement and the exhibits thereto.

        Based upon the foregoing, we are of the opinion that when the Shares have been duly issued and exchanged for the Tendered Units in accordance with the applicable partnership agreements of the Operating Partnerships and receipt of the Tendered Units has been properly reflected on the books and records of the Company, the Shares will be validly issued, fully paid and nonassessable.

        We hereby consent to being named as counsel to the Company in the Registration Statement, to the references therein to our firm under the caption "Legal Matters" and to the inclusion of this opinion as an exhibit to the Registration Statement.

                        Very truly yours,

                        /s/ Goodwin Procter LLP

                        GOODWIN PROCTER LLP




QuickLinks