EXHIBIT 5 PALMER & DODGE LLP One Beacon Street, Boston, MA 02108-3190 TELEPHONE: (617) 573-0100 FACSIMILE: (617) 227-4420 November 20, 1998 MAXIMUS, Inc. 1356 Beverly Road McLean, Virginia 22101 We are rendering this opinion in connection with the Registration Statement on Form S-3 (the "Registration Statement") filed by MAXIMUS, Inc. (the "Company") with the Securities and Exchange Commission under the Securities Act of 1933, as amended (the "Securities Act"), on or about the date hereof. The Registration Statement relates to up to 4,000,000 shares of the Company's Common Stock, no par value per share (the "Shares"), including 2,000,000 shares of Common Stock being sold by certain shareholders of the Company to the Underwriters. We understand that the Shares are to be offered and sold in the manner described in the Registration Statement. We have acted as your counsel in connection with the preparation of the Registration Statement and are familiar with the proceedings taken by the Company in connection with the authorization, issuance and sale of the Shares. We have examined all such documents as we consider necessary to enable us to render this opinion. Based upon the foregoing, we are of the opinion that upon the due execution and delivery of the Underwriting Agreement by the Company, the Selling Shareholders and the Underwriters and the due issuance and delivery of the Shares in accordance with the Underwriting Agreement against payment therefor as contemplated by the Registration Statement, the Shares will be valid, nonassessable and fully-paid. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to our firm under the caption "Legal Matters" in the prospectus filed as part thereof. Very truly yours, /s/ Palmer & Dodge LLP ------------------------------ Palmer & Dodge LLP