October 16, 1998 L.B. Foster Company 415 Holiday Drive Pittsburgh, Pennsylvania 15220 Re: Voluntary Investment Plan as Amended and Restated and Retirement Savings Plan for Non-Union Hourly Employees as Amended and Restated 2,000,000 Shares of Common Stock Ladies and Gentlemen: We have acted as your counsel in connection with the registration with the Securities and Exchange Commission (the "Commission") of 2,000,000 shares of your Common Stock, $.01 par value per share , (the "Shares") that may be acquired under the subject Plans by participants in the Plans. In that connection, we have examined originals or copies certified or otherwise identified to our satisfaction of such documents, corporate records and other instruments as we have deemed necessary or appropriate for the purposes of this opinion. Based on the foregoing, we are of the opinion that the Shares, when issued or delivered, and paid for, in accordance with the Plans, will have been validly issued and will be fully paid and nonassessable. In rendering this opinion we have of course assumed that the certificates evidencing the Shares will be properly executed and authenticated. We consent to the filing of this opinion with the Commission as an exhibit to the Registration Statement on Form S-8 for registration of the Shares under the Securities Act of 1933, as amended. Very truly yours, /s/ Klett Lieber Rooney & Schorling ------------------------------------- KLETT LIEBER ROONEY & SCHORLING, a Professional Corporation Exhibit 5