Exhibit (23) BROWN, EDWARDS & COMPANY, L.L.P. Certified Public Accountants CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM We consent to the incorporation by reference in the previously filed Registration Statement on Form S-8 (No. 333-36876) of FNB Corporation of our report dated February 21, 2006 related to the consolidated balance sheets of FNB Corporation and Subsidiaries as of December 31, 2005 and 2004, and the related consolidated statements of income and comprehensive income, changes in stockholders' equity, and cash flows for each of the three years in the period ended December 31, 2005, and our report dated February 21, 2006, with respect to management's report on internal control over financial reporting and the effectiveness of internal control over financial reporting appearing in the Annual Report on Form 10-K of FNB Corporation for the year ended December 31, 2005. s/Brown, Edwards & Company, L.L.P. CERTIFIED PUBLIC ACCOUNTANTS Christiansburg, Virginia February 21, 2006 Providing Professional Business Advisory & Consulting Services 100 Arbor Drive, Suite 108 Christiansburg, VA 24073 540-381-9333 Fax: 540-381-8319 www.BEcpas.com