Exhibit 5.1 [LETTERHEAD OF BOWLES RICE MCDAVID GRAFF & LOVE] August __, 1998 United Bankshares, Inc. 514 Market Street Parkersburg, West Virginia 26102 Re: Form S-4 Registration Statement ------------------------------- Ladies and Gentlemen: This opinion is rendered in connection with the Form S-4 Registration Statement (the "Registration Statement") filed by United Bankshares, Inc. (the "Registrant") with the Securities and Exchange Commission under the Securities Act of 1933, as amended, with respect to the proposed offering of up to 4,221,129 shares of common stock of Registrant, $2.50 par value ("Common Stock") issuable in connection with the proposed acquisition of Fed One Bancorp, Inc. ("Fed One"), Wheeling, West Virginia, by Registrant, pursuant to the terms of the Agreement and Plan of Merger dated February 18, 1998. We are of the opinion that if all the conditions set forth in the Merger Agreement among Fed One, Registrant and UBC Holding Company, Inc., a wholly-owned subsidiary of Registrant, and the related Plan of Merger (together the "Merger Agreement") are satisfied, the Common Stock, when issued in connection with the Merger Agreement in accordance with the terms set forth therein, will be duly authorized, validly issued, fully paid and nonassessable and will not be issued in violation of any preemptive rights of any shareholder of Registrant. We hereby consent to the use of this opinion as an exhibit to the Registration Statement and to the reference to our firm therein. Very truly yours, BOWLES RICE MCDAVID GRAFF & LOVE, P.L.L.C. /s/ Sandra M. Murphy ____________________ Sandra M. Murphy SMM/jam cc: Mr. Joseph Wm. Sowards