EX-5.1 3 d880056dex51.htm EX-5.1

Exhibit 5.1

November 1, 2024

Re: Registration Statement on Form S-3

Board of Directors Mid Penn Bancorp, Inc. 2407 Park Drive Harrisburg, Pennsylvania 17110

Ladies and Gentlemen:

We have acted as counsel to Mid Penn Bancorp, Inc., a Pennsylvania corporation (the “Company”), in connection with the preparation and filing of a Registration Statement on Form S-3 (File No. 333-274177) (the “Registration Statement”) with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”), and the rules and regulations promulgated thereunder, and declared effective by the Commission on September 1, 2023, the prospectus, dated August 23, 2023 (the “Prospectus”) and the prospectus supplement described below, filed with the Commission pursuant to Rule 424(b) of the rules and regulations of the Securities Act on November 1, 2024 (the “Prospectus Supplement”).

The Prospectus Supplement relates to the issuance and sale by the Company of an aggregate of 2,731,250 shares of common stock, $1.00 par value per share (the “Shares”), of the Company, pursuant to that certain Underwriting Agreement, dated November 1, 2024 (the “Underwriting Agreement”), by and between the Company and Piper Sandler & Co. and Stephens Inc., acting as representatives of the several underwriters named in Schedule I thereto.

We understand that the Shares are to be sold, as described in the Registration Statement, the Prospectus and the Prospectus Supplement, pursuant to the Underwriting Agreement filed as Exhibit 1.1 to the Current Report on Form 8-K to which this opinion is attached as Exhibit 5.1.

In rendering this opinion, we have examined and relied upon the Registration Statement, Prospectus and the Prospectus Supplement. We have also examined and relied upon such records, documents, certificates and other instruments as in our judgment are necessary or appropriate to form the basis for the opinions hereinafter set forth. In all such examinations, we have assumed the genuineness of signatures on original documents and the conformity to such original documents of all copies submitted to us as certified, conformed or photostatic copies, and as to certificates of public officials, we have assumed the same to have been properly given and to be accurate. We have further assumed the legal capacities of all natural persons. As to matters of fact material to this opinion, we have relied upon statements and representations of representatives of the Company and public officials.

4201 E. PARK CIRCLE | HARRISBURG, PA 17111 | 717•308•9910 | PILLARAUGHT.COM

This opinion letter is being furnished in accordance with the requirements of Item 601(b)(5) of Regulation S-K under the Securities Act.

Based on the foregoing, and subject to the assumptions, limitations and qualifications set forth herein, we are of the opinion that, upon the issuance and delivery of, and payment for, the Shares in the manner contemplated by the Underwriting Agreement, such Shares will be validly issued, fully paid and nonassessable.

Our opinion is rendered as of the date hereof, and we assume no obligation to advise you of changes in law or fact (or the effect thereof on the opinions expressed herein) that hereafter may come to our attention. This opinion is to be used only in connection with the offer and sale of the Shares while the Registration Statement is in effect.

The foregoing opinion is limited to the Federal laws of the United States and the laws of the Commonwealth of Pennsylvania, and we are expressing no opinion as to the effect of the laws of any other jurisdiction.

We hereby consent to the filing of this opinion with the Commission as an exhibit to the Registration Statement by means of its incorporation by reference from a Current Report on Form 8-K of the Company filed with the Commission and to the use of our name therein and in the Prospectus under the caption “Legal Matters.” In giving such consent, we do not thereby admit that we are an “expert” within the meaning of the Securities Act of 1933, as amended.

Sincerely,

/s/ Pillar Aught LLC

- 2 -