EXHIBIT 5 LEBOEUF, LAMB, GREENE & MACRAE, L.L.P. A LIMITED LIABILITY PARTNERSHIP INCLUDING PROFESSIONAL CORPORATIONS 260 FRANKLIN STREET BOSTON, MA 02110 July 26, 2000 Unitil Corporation 6 Liberty Lane West Hampton, NH 03842-1720 Ladies and Gentlemen: We have acted as counsel to Unitil Corporation, a New Hampshire corporation (the "Company"), in connection with the filing of a Registration Statement by the Company under the Securities Act of 1933, as amended (the "1933 Act"), on Form S-8 (the "Registration Statement"), providing for the registration of 150,000 shares (the "Plan Shares") of the Company's common stock, no par value, to be issued pursuant to the Company's Tax Deferred Savings and Investment Plan (the "Plan"). In connection with this opinion, we have examined originals or copies, certified or otherwise identified to our satisfaction, of such instruments, certificates, records and documents, and have reviewed such questions of law, as we have deemed necessary or appropriate for purposes of this opinion. In such examination, we have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as originals, the conformity to the original documents of all documents submitted to us as copies and the authenticity of the originals of all such latter documents. As to any facts material to this opinion, we have relied upon the aforesaid instruments, certificates, records and documents and inquiries of Company representatives. Unitil Corporation July 26, 2000 Page two Based upon the foregoing examination, and subject to the limitations set forth below, we are of the opinion that the Plan Shares will be validly issued, fully paid and nonassessable when: (a) the Registration Statement shall have become, and for so long as it shall remain, effective for the purpose of the issuance and sale of the Plan Shares; and (b) the consideration therefor provided for in the Plan has been received by the Company. This opinion is rendered under and limited to the New Hampshire Business Corporation Act (without reference to "blue sky" matters) and the federal law of the United States. We consent to the filing of this opinion as Exhibit 5 to the Registration Statement and in any amendments thereto. In giving such consent, we do not thereby concede that we are within the category of persons whose consent is required under Section 7 of the 1933 Act, or the rules and regulations of the Securities and Exchange Commission thereunder. Very truly yours, /s/ LeBoeuf, Lamb, Greene & MacRae, L.L.P.