Exhibit 8.1

Direct Dial: 804.420.6000
March 28, 2024
National Bankshares, Inc.
101 Hubbard Street
Blacksburg, Virginia 24062
| Re: | Federal Income Tax Opinion Issued to National Bankshares, Inc. in Connection with the Merger of Frontier Community Bank with and into The National Bank of Blacksburg. |
Ladies and Gentlemen:
We have acted as counsel to National Bankshares, Inc., a Virginia corporation (“Parent”), in connection with the proposed merger (the “Merger”) of Frontier Community Bank, a Virginia banking corporation (“FCB”), with and into The National Bank of Blacksburg, a national banking association and wholly-owned subsidiary of Parent (“NBB”), pursuant to the Agreement and Plan of Merger, dated as of January 23, 2024, between Parent, NBB, and FCB (the “Merger Agreement”). At your request, and in connection with the filing by Parent of a Registration Statement on Form S-4 (as amended or supplemented through the date hereof, the “Registration Statement”), including the Proxy Statement/Prospectus contained therein, with the Securities and Exchange Commission (the “Commission”), we are rendering our opinion concerning certain United States federal income tax consequences of the Merger. Any capitalized term used and not defined herein has the meaning given to it in the Merger Agreement.
FACTS:
In connection with the opinion rendered below, we have reviewed and relied upon (i) the Merger Agreement; (ii) the Proxy Statement/Prospectus contained in the Registration Statement; and (iii) such other documents as we have deemed necessary or appropriate for purposes of this opinion letter (the documents referred to in clauses (i), (ii), and (iii) hereof are referred to, collectively, as the “Merger Documents”). With respect to various factual matters material to our opinion, we have relied upon the representations set forth in the Merger Documents and in certificates of each of Parent and FCB (the “Certificates”). We have assumed the correctness of the factual matters contained in the Merger Documents and the Certificates and have made no independent investigation for the purpose of confirming that such matters are correct.
We have assumed that: (i) all signatures on all documents submitted to us are genuine, all documents submitted to us as originals are authentic, all documents submitted to us as copies conform to the originals thereof, all information submitted to us is accurate and complete, and all persons executing and delivering originals or copies of documents examined by us are competent to