EXHIBIT 5.1 June 29, 1999 The Keith Companies, Inc. 2955 Red Hill Avenue Costa Mesa, CA 92626 Ladies and Gentlemen: At your request, we have examined the form of Registration Statement on Form S-1 (the "Registration Statement") which has been filed by The Keith Companies, Inc. (the "Company") with the Securities and Exchange Commission pursuant to the Securities Act of 1933, as amended (the "Act"), for the purpose of registering 2,012,500 shares of Common Stock of the Company (including 262,500 shares of Common Stock which may be purchased by the Underwriters to cover over-allotments, if any). We have examined the proceedings taken and proposed to be taken in connection with the issuance and sale of securities in the manner set forth in the Registration Statement, as amended. Subject to the completion of the proceedings contemplated in connection with the foregoing matters, we are of the opinion that all of the securities included in the Registration Statement for sale by the Company have been duly authorized and, when issued and sold in the manner set forth in the Registration Statement will, upon such issuance and sale, be validly and legally issued, fully paid and nonassessable. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement, and to the use of our name under the caption "Legal Matters" in the Registration Statement. Respectfully submitted, RUTAN & TUCKER, LLP