EX-5.1 3 d791984dex51.htm EX-5.1

Exhibit 5.1

March 28, 2024

Board of Directors

National Bankshares, Inc.

101 Hubbard Street

Blacksburg, Virginia 24060

| Re: | Registration Statement on Form S-4

Ladies and Gentlemen:

We have acted as counsel to National Bankshares, Inc., a Virginia corporation (the “Company”), and are delivering this opinion letter in connection with the Registration Statement on Form S-4 (the “Registration Statement”) filed by the Company with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”). The Registration Statement covers the offering of up to 536,993 shares of the Company’s common stock, par value $1.25 per share (the “Securities”), and includes a proxy statement/prospectus to be furnished to the shareholders of Frontier Community Bank, a Virginia banking corporation (“Frontier”). The Securities are proposed to be issued to the shareholders of Frontier pursuant to the Agreement and Plan of Merger, dated January 23, 2024, by and among the Company, The National Bank of Blacksburg, a national banking association and wholly-owned bank subsidiary of the Company, and Frontier (the “Merger Agreement”). This opinion letter is provided pursuant to the requirements of Item 21(a) of Form S-4 and Item 601(b)(5) of Regulation S-K of the Commission.

In our capacity as your counsel and as a basis for the opinion hereafter expressed, we have examined (i) the Registration Statement, (ii) the Merger Agreement, (iii) the Company’s articles of incorporation and bylaws, (iv) certificates of public officials and of representatives of the Company, and (v) such corporate proceedings, records and documents as we have considered necessary for the purposes of this opinion letter. In conducting our examination of documents executed or to be executed, we have assumed that the parties thereto, other than the Company, had or will have the power, corporate or other, to enter into and perform all obligations thereunder and also have assumed the due authorization by all requisite action, corporate or other, and the due execution and delivery by such parties of such documents and the validity, binding effect and enforceability thereof on or against such parties. We have further assumed (i) that the signatures on all documents examined by us are genuine, (ii) that all documents submitted to us as originals are authentic, (iii) that all documents submitted to us as copies conform to the originals thereof, (iv) the legal capacity of natural persons, (v) that the Securities will be issued upon the terms and conditions set forth in the Merger Agreement and (vi) the Registration Statement will have become effective under the Securities Act.

On the basis of the foregoing, and subject to the qualifications and limitations set forth herein, we are of the opinion that the Securities have been duly authorized and, when issued and delivered in accordance with the terms of the Merger Agreement, will be validly issued, fully paid and non-assessable.

This opinion letter is limited to the laws of the Commonwealth of Virginia, and we express no opinion as to the effect of the laws of any other jurisdiction. We assume no obligation to advise you or any other person, or to make any investigations, as to any legal developments or factual matters arising subsequent to the date of effectiveness of the Registration Statement that might affect the opinion expressed herein.

We hereby consent to the filing of this opinion letter as Exhibit 5.1 to the Registration Statement and the references to our name therein, as well as under the heading “Legal Matters” in the related joint proxy statement/prospectus. In giving this consent, we do not thereby admit that we are within the category of persons whose consent is required by Section 7 of the Securities Act or the rules and regulations of the Commission thereunder.

/s/ WILLIAMS MULLEN