Exhibit 5.1

img262837528_0.jpg

111 N. Sixth Street
P.O. Box 679
Reading, PA 19603
(610) 478-2000
www.stevenslee.com

 

August 20, 2026

Board of Directors

QNB Corp.

15 North Third Street, P.O. Box 9005

Quakertown, Pennsylvania 18951-9005

 

Re: Form S-3 Registration Statement

 

Ladies and Gentlemen:

 

We have acted as counsel to QNB Corp. (the “Company”) in connection with its Registration Statement on Form S-3 (File No. 333-298129) (the “Registration Statement”), filed by the Company with the Securities and Exchange Commission (the “Commission”) pursuant to the Securities Act of 1933, as amended (the “Act”), relating to the proposed public offering of 1,071,428 shares of common stock, $0.625 par value per share, of the Company (“Common Stock”), which includes 160,714 shares subject to the underwriters’ over-allotment option (collectively, the “Shares”), pursuant to the Underwriting Agreement, dated August 19, 2026 (the “Underwriting Agreement”), by and among the Company, QNB Bank, Brean Capital, LLC and Performance Trust Capital Partners, LLC. This opinion letter is furnished to you at your request to enable the Company to fulfill the requirements of Item 16 to Form S-3 and Item 601(b)(5) of Regulation S-K, 17 C.F.R. § 229.601(b)(5), in connection with the Registration Statement.

In rendering this opinion letter, we have reviewed copies of: (1) the Underwriting Agreement; (2) the Registration Statement; (3) the base prospectus, dated August 14, 2026, which forms a part of the Registration Statement; (4) the preliminary prospectus supplement, dated August 19, 2026, in the form filed with the SEC pursuant to Rule 424(b) of the Securities Act; (5) the final prospectus supplement, dated August 19, 2026, in the form filed with the SEC pursuant to Rule 424(b) of the Securities Act; (6) the Articles of Incorporation of the Company, as amended; (7) the Amended and Restated Bylaws of the Company; and (8) certain resolutions of the Board of Directors of the Company and the Executive Committee and the Pricing Committee thereof. We have also reviewed such other documents and made such other investigations as we have deemed appropriate.

In our examination, we have assumed: (1) the genuineness of all signatures; (2) the legal capacity of all natural persons; (3) the authenticity of all documents submitted to us as original documents; (4) the conformity to original documents of all documents submitted to us as copies thereof; (5) that the Underwriting Agreement has been duly authorized and validly executed and delivered by the parties thereto (other than the Company and QNB Bank); and (6) the Shares will

Allentown Bergen County Bala Cynwyd Cleveland Fort Lauderdale Harrisburg Lancaster New York
Philadelphia
Princeton Reading Rochester Scranton Valley Forge Wilkes-Barre Wilmington

A PROFESSIONAL CORPORATION

 

8/20/2026 SL1 4648276v2 101000.00064


 

img262837528_1.jpg

Board of Directors

August 20, 2026

Page 2

 

 

be issued and sold in compliance with applicable U.S. federal and state securities laws and in the manner stated in the Underwriting Agreement and the Registration Statement. As to various questions of fact material to this opinion, we have relied, without independent investigation, upon the statements contained in the Registration Statement and statements of officers of the Company.

Our opinion expressed herein is limited to Pennsylvania corporate law and we express no opinion with respect to any other laws, or with respect to any matter pertaining to the contents of the Registration Statement.

Based on the foregoing and subject to the limitations, qualifications, exceptions and assumptions set forth herein, we are of the opinion that the Shares, when issued and sold against payment therefor as provided in the Underwriting Agreement, will be validly issued, fully paid and non-assessable.

This opinion has been prepared in connection with the Registration Statement. We assume no obligation to advise you of any changes in the foregoing subsequent to the date hereof.

We hereby consent to our firm being referenced under the caption “Legal Matters” in the base prospectus and in the prospectus supplement and to the inclusion of this opinion as an exhibit to the Registration Statement. By giving such consent, we do not hereby admit that we are in the category of persons whose consent is required under Section 7 of the Act or the rules and regulations of the Commission.

Very truly yours,

STEVENS & LEE, P.C.

/s/ Stevens & Lee, P.C.

 

 

 

 

 

 

8/20/2026 SL1 4648276v2 101000.00064