EXHIBITS 5 AND 23.3 Mays & Valentine, L.L.P. Letterhead [FORM OF OPINION] 804/697-1265 11992.016 April 7, 1998 Union Bankshares Corporation 212 N. Main Street Bowling Green, Virginia 22427-0446 Gentlemen: We have participated in the preparation of the Registration Statement under the Securities Act of 1933 on Form S-4, including Exhibits (the "Registration Statement"), of Union Bankshares Corporation ("Union") relating to the registration of 158,209 shares of Union Common Stock, $4.00 par value, to be issued by Union pursuant to the merger transaction by and between Rappahannock Bankshares, Inc. and Union (the "Merger") in accordance with the Agreement and Plan of Affiliation and Merger made as of February 25, 1998. We have been requested to furnish an opinion to be included as an exhibit to the Registration Statement. In connection with the furnishing of our opinion, we have examined, among other things, the Articles of Incorporation and Bylaws of Union. We have also examined the Agreement and Plan of Affiliation and Merger, the minutes of the proceedings of the Board of Directors of Union, the Registration Statement, and such other records and documents as we deem pertinent. Based on the foregoing, with regard to the legality of the issuance of the Union Common Stock being registered under the Registration Statement, it is our opinion that: 1. Union has been duly incorporated and is validly existing as a corporation in good standing under the laws of the State of Virginia, with full power and authority to carry on business in which it is now and will be engaged. 2. The 158,209 shares of Union Common Stock being registered under the Registration Statement pursuant to the Merger will, when issued, be legally issued, fully paid and non-assessable. Union Bankshares Corporation April 7, 1998 Page 2 We hereby consent to the filing of this opinion with the Securities and Exchange Commission as an exhibit to the Registration Statement and to the reference to us under the caption "Legal Opinions" in the Proxy Statement contained therein. Sincerely, /s/ Mays & Valentine, L.L.P.