![slide1](https://capedge.com/proxy/S-8/0001050441-21-000064/eaglebancorpinc-ex5opini001.jpg)
115816475v3 Troutman Pepper Hamilton Sanders LLP 400 Berwyn Park, 899 Cassatt Road Berwyn, PA 19312-1183 troutman.com Exhibit 5.1 August 9, 2021 Eagle Bancorp, Inc. 7830 Old Georgetown Road, Third Floor Bethesda, Maryland 20814 Re: Registration Statement on Form S-8 Ladies and Gentlemen: Reference is made to the registration statement on Form S-8 (the “Registration Statement”) of Eagle Bancorp, Inc., a Maryland corporation (the “Company”), filed on the date hereof with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Act”). The Registration Statement covers up to 1,724,578 shares of the Company’s common stock, par value $0.01 per share, pursuant to the Eagle Bancorp, Inc. 2021 Equity Incentive Plan and 200,000 shares of the Company’s common stock, par value $0.01 per share (together with the shares registered pursuant to the Eagle Bancorp, Inc. 2021 Equity Incentive Plan, the “Shares”), pursuant to the Eagle Bancorp, Inc. 2021 Employee Stock Purchase Plan (together with the Eagle Bancorp, Inc. 2021 Equity Incentive Plan, the “Plans”). We have examined the Registration Statement, including the exhibits thereto, the originals or copies, certified or otherwise identified to our satisfaction, of the Articles of Incorporation of Eagle Bancorp, Inc. (as amended through May 16, 2016), the Bylaws of Eagle Bancorp, Inc. (as amended through December 14, 2017), the Plans and such other agreements, instruments and documents as we have deemed appropriate in rendering this opinion. As to matters of fact, we have relied on certain representations of officers of the Company. In rendering this opinion, we have assumed the genuineness and authenticity of all signatures on original documents; the legal capacity of all natural persons; the authenticity of all documents submitted to us as originals; the conformity to originals of all documents submitted to us as certified or photocopies; the accuracy and completeness of all documents and records reviewed by us; the accuracy, completeness and authenticity of certificates issued by any governmental official, office or agency and the absence of change in the information contained therein from the effective date of any such certificate; and the due authorization, execution and delivery of all documents where authorization, execution and delivery are prerequisites to the effectiveness of such documents. We express no opinion herein as to the law of any state or jurisdiction other than the laws of the State of Maryland, including statutory provisions and all applicable provisions of the Maryland Constitution and reported judicial decisions interpreting such laws of such states and the federal laws of the United States of America. 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. Based on the foregoing, we are of the opinion that the Shares, when issued in accordance with the terms of the Plans, will be validly issued, fully paid and non-assessable.
![slide2](https://capedge.com/proxy/S-8/0001050441-21-000064/eaglebancorpinc-ex5opini002.jpg)
115816475v3 We hereby consent to the filing of this opinion as an exhibit to the Registration Statement. In giving such consent, we do not thereby admit that we come within the category of persons whose consent is required under Section 7 of the Act or the rules or regulations of the Commission thereunder. Very truly yours, /s/ Troutman Pepper Hamilton Sanders LLP Troutman Pepper Hamilton Sanders LLP