EXHIBIT 5 Opinion of Kennedy & Baris, L.L.P. July 2, 1996 Board of Directors Sandy Spring Bancorp, Inc. 17801 Georgia Avenue Olney, Maryland 20832 Ladies and Gentlemen: As counsel to Sandy Spring Bancorp, Inc. (the "Company"), we have participated in the preparation of the Company's Registration Statement on Form S-4 to be filed with the Securities and Exchange Commission pursuant to the Securities Act of 1933, as amended, relating to the issuance of up to 556,705 shares of the Company's Common Stock (the "Shares") in connection with the proposed merger of Annapolis Bancshares, Inc. with and into the Company. As counsel to the Company, we have examined such corporate records, certificates and other documents as we have deemed necessary or appropriate for purposes of this opinion. Based upon such examinations, we are of the opinion that the Shares, when issued in the manner set forth in the Registration Statement, will be duly authorized, validly issues, fully paid and non-assessable shares of the Common Stock of the Company. We hereby consent to the inclusion of this opinion as an exhibit to the Registration Statement on Form S-4 filed by the Company and to the reference to our firm contained therein under the caption "Legal Matters." Sincerely,