Exhibit 5.1 Cooley Godward LLP [LETTERHEAD] Cooley Godward LLP [LOGO] June 5, 2003 VaxGen, Inc. 1000 Marina Boulevard, Suite 200 Brisbane, California 94005 Ladies and Gentlemen: You have requested our opinion with respect to certain matters in connection with the sale by VaxGen, Inc., a Delaware corporation (the "Company"), of one million five hundred ninety-one thousand three hundred seven (1,591,307) shares of the Company's common stock, $0.01 par value (the "Shares"), pursuant to a Registration Statement on Form S-3 and the related Prospectus and Prospectus Supplement filed with the Securities and Exchange Commission (the "Commission"). All of the Shares are to be sold by the Company as described in the Registration Statement and related Prospectus and Prospectus Supplement. In connection with this opinion, we have examined and relied upon the Registration Statement and related Prospectus included therein, the Prospectus Supplement filed with the Commission pursuant to Rule 424 under the Securities Act of 1933, as amended, the Company's Amended and Restated Certificate of Incorporation and Bylaws, as currently in effect, and the originals or copies certified to our satisfaction of such other records, documents, certificates, memoranda and other instruments as we deem necessary or appropriate to enable us to render the opinion expressed below. We have assumed the genuineness and authenticity of all documents submitted to us as originals, the conformity to originals of all documents submitted to us as copies thereof and the due execution and delivery of all documents where due execution and delivery are a prerequisite to the effectiveness thereof. On the basis of the foregoing, and in reliance thereon, we are of the opinion that the Shares, when sold in accordance with the Registration Statement and the related Prospectus and Prospectus Supplement, will be validly issued, fully paid and nonassessable. We consent to the reference to our firm under the caption "Legal Matters" in the Prospectus and the Prospectus Supplement included in the Registration Statement and to the filing of this opinion as an exhibit to the Registration Statement. Very truly yours, COOLEY GODWARD LLP By: /s/ Laura A. Berezin -------------------------------- Laura A. Berezin