Exhibit 5.1 1500 Fleet Center Providence, Rhode Island 02903 401 274-2000 FAX: 401 277-9600 HINCKLEY, ALLEN & SNYDER Attorneys at Law October 21, 1998 Providence and Worcester Railroad Company 75 Hammond Street Worcester, MA 01610 RE: Registration Statement on Form S-8 for Anniversary Stock Plan Ladies and Gentlemen: We have acted as counsel to Providence and Worcester Railroad Company, a Rhode Island corporation, (the "Company") in connection with the filing by the Company of a Registration Statement on Form S-8 (the "Registration Statement") with the Securities and Exchange Commission relating to 5,000 shares of the Company's common stock, par value $.50 per share (the "Common Stock"), issuable under its Anniversary Stock Plan (the "Plan"). In connection with this opinion, we have examined the Company's Charter, By-laws, the Registration Statement, corporate proceedings of the Company relating to the issuance of the Common Stock, the Plan and such other instruments and documents as we have deemed relevant under the circumstances. In making the aforesaid examination, we have assumed the genuineness of all signatures and the conformity to original documents of all copies furnished to us as original or photostatic copies. Based upon and subject to the foregoing, we are of the opinion that the Common Stock which may be issued under the Plan has been duly authorized and when issued in accordance with the terms of the Plan will be validly issued, fully paid and non-assessable. We hereby consent to the use of our opinion as herein set forth as an exhibit to the Registration Statement. This opinion is rendered to you in connection with the Registration Statement, and except as consented to in the preceding sentence, may not be relied upon or furnished to any other person in any context. In giving such consent, we do not thereby admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act of 1933 or the rules and regulations of the Securities and Exchange Commission thereunder. Very truly yours, /s/ Hinckley, Allen & Snyder