Exhibit 23 Accountants' Consent The Board of Directors National Bankshares, Inc. We consent to incorporation by reference in Registration Statement No. 333- 79979 on Form S-8 of National Bankshares, Inc. of our report dated February 11, 2000, relating to the consolidated balance sheets of National Bankshares, Inc. and subsidiaries as of December 31, 1999 and 1998, and the related consolidated statements of income and comprehensive income, changes in stockholders' equity, and cash flows for each of the years in the three-year period ended December 31, 1999, which report is incorporated by reference in the December 31, 1999 Annual Report on Form 10-K of National Bankshares, Inc. KPMG LLP Roanoke, Virginia March 28, 2000