Exhibit 5.1
[Letterhead of Troutman Pepper Locke LLP]



June 8, 2026

The Southern Company
30 Ivan Allen Jr. Blvd., N.W.
Atlanta, Georgia 30308

Re:   Registration Statement on Form S-3

Ladies and Gentlemen:

We have acted as counsel to The Southern Company, a Delaware corporation (the "Company"), in connection with the Registration Statement on Form S-3 (Registration Statement No. 333-296531) filed with the Securities and Exchange Commission (the "Commission") on June 5, 2026 (the "Registration Statement") under the Securities Act of 1933, as amended (the "Securities Act"), relating to the registration pursuant to the provisions of the Securities Act of 50,000,000 shares (the "Shares") of the Company's common stock, par value $0.01 per share, for issuance pursuant to (i) the Distribution Agreement dated as of June 8, 2026 (the "Agreement"), among the Company and each of Barclays Capital Inc., BMO Capital Markets Corp., BofA Securities, Inc., BTIG, LLC, Citigroup Global Markets Inc., Goldman Sachs & Co. LLC, Jefferies LLC, J.P. Morgan Securities LLC, Mizuho Securities USA LLC, Morgan Stanley & Co. LLC, MUFG Securities Americas Inc., Nomura Securities International, Inc. (acting through BTIG, LLC as agent), RBC Capital Markets, LLC, Santander US Capital Markets LLC, Scotia Capital (USA) Inc., Truist Securities, Inc. and Wells Fargo Securities, LLC, as agents and/or principals (each, an "Agent" and, collectively, the "Agents"), and Barclays Bank PLC, Bank of Montreal, Bank of America, N.A., Citibank, N.A., Goldman Sachs & Co. LLC, Jefferies LLC, JPMorgan Chase Bank, N.A., Mizuho Markets Americas LLC, Morgan Stanley & Co. LLC, MUFG Securities EMEA pie, Nomura Global Financial Products, Inc., Royal Bank of Canada, Banco Santander, S.A., The Bank of Nova Scotia, Truist Bank and Wells Fargo Bank, National Association, as forward purchasers (collectively, the "Forward Purchasers"), (ii) separate letter agreements in the form attached as Exhibit B- to the Agreement that may from time to time be entered into with any of the Forward Purchasers (each, an "Initially-Priced Forward Confirmation"), and (iii) separate lette agreements in the form attached as Exhibit B-2 to the Agreement that may from time to time be entered into with any of the Forward Purchasers ( each a "Collared Forward Confirmation' and, together with the Initially-Priced Forward Confirmations, the "Confirmations").

In rendering this opinion, we have examined the Registration Statement, the Agreement, the form of Initially-Priced Forward Confirmation included as Exhibit B-1 to the Agreement, the form of Collared Forward Confirmation included as Exhibit B-2 to the Agreement and copies of the Company's Restated Certificate of Incorporation and Amended and Restated By-Laws, each as certified to us by an officer of the Company. We also have reviewed minutes of proceedings of the Board of Directors of the Company relating to the issuance and sale of the Shares and such other documents as we have deemed necessary for purposes of this opinion. In such examinations, we have assumed the genuineness of all



















June 8, 2026
Page 2


signatures on all original documents, the authenticity of all documents submitted to us as originals, the conformity to the original documents of all copies submitted to us, the authenticity of the originals of documents submitted to us as copies and the due execution and delivery of all documents where due execution and delivery are prerequisite to the effectiveness thereof.

Based upon the foregoing examination, we are of the opinion that, subject to compliance with the pertinent provisions of the Securities Act and to compliance with such securities or "Blue Sky" laws of any jurisdiction as may be applicable, when the Shares have been issued in accordance with the terms of the Agreement and any applicable Confirmation, the Shares will be duly and validly issued, fully paid and non-assessable.

In expressing the opinions set forth above, we are not passing on the laws of any jurisdiction other than the General Corporation Law of the State of Delaware and the federal law of the United States of America.

We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the statement with respect to our firm under the caption "Legal Matters" in the prospectus forming part of the Registration Statement. In giving the foregoing consent, we do not admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Commission thereunder.

This opinion may not be relied upon, furnished or quoted by you for any other purpose, without our prior written consent.

                                                                                 Very truly yours,

                                                                                 /s/ Troutman Pepper Locke LLP