EX-5.1 2 tm2512551d4_ex5-1.htm EXHIBIT 5.1

Exhibit 5.1

|  | Kilpatrick Townsend & Stockton LLP 701 Pennsylvania Avenue, NW, Suite 200 Washington, DC 20004 202.508.5800 www.ktslaw.com

April 30, 2025

Board of Directors

Bar Harbor Bankshares

82 Main Street

Bar Harbor, Maine 04609

| Re: | Registration Statement on Form S-4

Ladies and Gentlemen:

We have acted as special counsel for Bar Harbor Bankshares, a Maine corporation (the “Company”), in connection with the Registration Statement on Form S-4 (the “Registration Statement”) initially filed on April 18, 2025, by the Company with the Securities and Exchange Commission under the Securities Act of 1933, as amended (the “Act”), and the regulations promulgated thereunder.

The Registration Statement relates to the proposed issuance by the Company of up to 1,350,562 shares (the “Shares”) of common stock, $2.00 par value per share, of the Company, pursuant to the Agreement and Plan of Merger, dated as of March 11, 2025 (the “Agreement”), by and among the Company and Guaranty Bancorp, Inc., a New Hampshire corporation (“Guaranty”).

The Agreement provides for the merger of Guaranty with and into the Company, with the Company as the surviving entity (the “Merger”). The Registration Statement contains a proxy statement/prospectus to be furnished to the shareholders of Guaranty in connection with their consideration of the Merger. In the preparation of this opinion, we have examined originals or copies identified to our satisfaction of: (i) the articles of incorporation of the Company; (ii) the bylaws of the Company; (iii) certain resolutions of the Board of Directors of the Company relating to the issuance of the Shares being registered under the Registration Statement; (iv) the Agreement; and (v) the Registration Statement, including the proxy statement/prospectus contained therein and the exhibits thereto. We have also examined originals or copies of such documents, corporate records, certificates of public officials and other instruments, and have conducted such other investigations of law and fact, as we have deemed necessary or advisable for purposes of our opinion.

In our examination, we have assumed, without investigation, the genuineness of all signatures, the authenticity of all documents and instruments submitted to us as originals, the conformity to the originals of all documents and instruments submitted to us as certified or conformed copies, the correctness of all certificates, and the accuracy and completeness of all records, documents, instruments and materials made available to us by the Company.

Board of Directors

Bar Harbor Bankshares

April 30, 2025

Page 2

Our opinion is limited to the matters set forth herein, and we express no opinion other than as expressly set forth herein. This opinion is limited solely to the laws of the State of Maine. Our opinion is expressed as of the date hereof and is based on laws currently in effect. Accordingly, the conclusions set forth in this opinion are subject to change in the event that any laws should change or be enacted in the future. We are under no obligation to update this opinion or to otherwise communicate with you in the event of any such change.

For purposes of this opinion, we have assumed that, prior to the issuance of any Shares, (1) the Registration Statement, as finally amended, will have become effective under the Act and (2) the Merger will have become effective. Based upon and subject to the foregoing, it is our opinion that the Shares, when issued in accordance with the terms of the Agreement upon consummation of the Merger contemplated therein, will be validly issued, fully paid and nonassessable.

We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to this firm under the caption “Legal Matters” in the proxy statement/prospectus forming a part of the Registration Statement. In giving such consent, we do not hereby admit that we are experts or are otherwise within the category of persons whose consent is required under Section 7 of the Act or the rules or regulations of the Securities and Exchange Commission thereunder.

| Very truly yours,
| /s/ KILPATRICK TOWNSEND & STOCKTON LLP