


                              Davis Polk & Wardwell
                               450 Lexington Ave.
                               New York, NY 10017
                                 (212) 450-4000

                                 August 13, 1997

The AES Corporation
1001 North 19th Street
Arlington, Virginia 22209

Ladies and Gentlemen:

     We have acted as special counsel to The AES Corporation  (the "Company") in
connection  with the Company's  offer (the  "Exchange  Offer") to exchange its 8
3/8% Senior Subordinated Exchange Notes (the "New Notes") for any and all of its
outstanding 8 3/8% Senior Subordinated Notes (the "Old Notes").

     We have examined originals or copies,  certified or otherwise identified to
our satisfaction,  of such documents,  corporate records, certificates of public
officials and other instruments as we have deemed necessary or advisable for the
purpose of rendering this opinion.

     Upon the basis of the foregoing,  we are of the opinion that the New Notes,
when  executed,  authenticated  and  delivered  in exchange for the Old Notes in
accordance with the Exchange Offer will be valid and binding  obligations of the
Company  enforceable  in  accordance  with their  terms,  subject to  applicable
bankruptcy,  insolvency,  or similar laws affecting  creditors' rights generally
and general principles of equity.

     We are  members  of the Bar of the  State  of New  York  and the  foregoing
opinion is limited to the laws of the State of New York, the federal laws of the
United  States  of  America  and the  General  Corporation  Law of the  State of
Delaware.


<PAGE>


The AES Corporation                     2                        August 13, 1997

     We hereby  consent  to the  filing of this  opinion  as an  exhibit  to the
Registration  Statement  relating to the Exchange  Offer. We also consent to the
reference to us under the caption "Legal Matters" in the Prospectus contained in
such Registration Statement.

     This opinion is rendered solely to you in connection with the above matter.
This opinion may not be relied upon by you for any other  purpose or relied upon
by or furnished to any other person  without our prior  written  consent  except
that the Bank of New York,  as Exchange  Agent for the  Exchange  Offer may rely
upon this opinion as if it were addressed directly to it.

                                                     Very truly yours,

                                                     /s/ Davis Polk & Wardwell

