1 EXHIBIT 5 M&T Bank Corporation One M&T Plaza Buffalo, NY 14203 July 28, 2000 Board of Directors M&T Bank Corporation One M&T Plaza Buffalo, NY 14203 Ladies and Gentlemen: This opinion is rendered in connection with the Registration Statement on Form S-4 (the "Registration Statement") of M&T Bank Corporation, a New York corporation ("M&T"), to be filed with the Securities and Exchange Commission under the Securities Act of 1933, as amended (the "Securities Act"), relating to the registration of 1,725,000 shares of M&T's common stock, par value $5.00 per share ("M&T Common Stock"), in connection with that certain Agreement and Plan of Reorganization dated as of May 16, 2000 (the "Reorganization Agreement"), by and among M&T, Keystone Financial, Inc. ("Keystone"), a Pennsylvania corporation, and Olympia Financial Corp. ("Olympia"), a Delaware corporation and wholly owned subsidiary of M&T, and that certain related Agreement and Plan of Merger dated as of May 16, 2000 (the "Merger Agreement" and together with the Reorganization Agreement, the "Agreements"), by and among M&T, Keystone and Olympia. Subject to certain conditions, the Agreements provide for the merger (the "Merger") of Keystone with and into Olympia. As Senior Vice President and General Counsel of M&T, I have participated in the preparation of the Registration Statement, including the prospectus included therein. 2 Board of Directors M&T Bank Corporation July 28, 2000 Page 2 I have acted as counsel to M&T with respect to the authorization and issuance of the M&T Common Stock covered by the Registration Statement. I have reviewed M&T's Restated Certificate of Incorporation and Bylaws, each as amended to date, the Registration Statement, the Agreements and the proceedings taken by M&T relating to the Agreements and the Registration Statement, including the resolutions adopted by M&T's Board of Directors with respect thereto. I also have examined such corporate records, certificates and other documents that I have considered necessary or appropriate for the purposes of this opinion. In making such examination and rendering the opinions set forth below, I have assumed: (i) the genuineness and authenticity of all signatures (other than my own) on original documents; (ii) the authenticity of all documents submitted to me as originals; and (iii) the conformity to originals of all documents submitted to me as certified, telecopied, photostatic or reproduced copies and the authenticity of all originals of such documents. In addition, I have assumed the due authorization and issuance of the outstanding shares of common stock of Keystone in accordance with applicable law. I also have assumed that either the 10-for-1 split of M&T Common Stock contemplated by the Reorganization Agreement shall have become effective prior to the effectiveness of the Merger or, in the alternative, the condition to Keystone's obligation to consummate the Merger that such stock split shall have become effective prior to the effectiveness of the Merger, as set forth in Section 5.2(d) of the Reorganization Agreement, shall have been waived. I am admitted to practice law in the State of New York and do not purport 3 Board of Directors M&T Bank Corporation July 28, 2000 Page 3 to be an expert on or to express any opinion on any laws other than the laws of the State of New York and the federal laws of the United States of America. This opinion speaks as of today's date and is limited to present statutes, regulations and judicial interpretations. In rendering this opinion, I assume no obligation to revise or supplement this opinion should the present laws be changed by legislative or regulatory action, judicial decision or otherwise. Based upon the foregoing, I am of the opinion that the shares of M&T Common Stock issuable in the Merger have been duly authorized and, when issued to the stockholders of Keystone pursuant to, and in accordance with, the terms of the Agreements, will be validly issued, fully paid and nonassessable. This letter does not address any matters other than those expressly addressed herein. This letter is given for your sole benefit and use. No one else is entitled to rely hereupon. I hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to me under the caption "Legal Opinion" in the prospectus, which is part of the Registration Statement. In giving such consent, I do not thereby admit that I am in the category of persons whose consent is required under Section 7 of the Securities Act. Very truly yours, /s/ Richard A. Lammert --------------------------- Richard A. Lammert Senior Vice President and General Counsel