Exhibit 5.1 October 24, 2002 United Community Bancorp 1039 Second Street, NE Hickory, North Carolina 28601-3843 RE: Registration Statement Gentlemen: We have acted as counsel to United Community Bancorp (the "Company"), in connection with the preparation of a Registration Statement on Form S-4 (the "Registration Statement") to be filed by the Company with the Securities and Exchange Commission under the Securities Act of 1933, as amended (the "Act"), relating to the registration of up to 2,121,000 shares (the "Shares") of the Company's common stock, $1.00 par value per share ("Common Stock") to be exchanged for shares of common stock of Community Bancshares, Inc. ("Community") in connection with the Agreement and Plan of Merger between the Company and Community, dated August 2, 2002. This opinion is furnished pursuant to the requirement of Item 601(b)(5) of Regulation S-B under the Act. We have examined the Articles of Incorporation filed by the Company with the North Carolina Secretary of State, the Bylaws of the Company, minutes of meetings of its Board of Directors, and such other corporate records of the Company and other documents and have made such examinations of law as we have deemed necessary for purposes of this opinion. Based on and subject to the foregoing and to the additional qualifications set forth below, it is our opinion that the Shares that are being offered and sold by the Company pursuant to the Registration Statement, when issued by the Company as contemplated by the Registration Statement, will be legally issued, fully paid and nonassessable. We hereby consent to the reference to our firm in the Registration Statement under the heading "Legal Matters" and to the filing of this opinion as an exhibit to the Registration Statement. Such consent shall not be deemed to be an admission that this firm is within the category of persons whose consent is required under Section 7 of the Act or the regulations promulgated pursuant to the Act. This opinion is limited to the laws of the State of North Carolina and no opinion is expressed as to the laws of any other jurisdiction. This opinion is rendered solely for your benefit and that of your shareholders and shareholders of Community in connection with the transaction described above and may not be used or relied upon by any other person without prior written consent in each instance. Very truly yours, GAETA & ASSOCIATES, P.A. By: /s/ Anthony Gaeta, Jr.