EXHIBIT 5.1 650 PAGE MILL ROAD PALO ALTO, CALIFORNIA 94304-1050 TELEPHONE 650-493-9300 FACSIMILE 650-493-6811 WWW.WSGR.COM August 9, 1999 BioMarin Pharmaceutical Inc. 371 Bel Marin Keys Boulevard, Suite 210 Novato, CA 94949 Re: Registration Statement on Form S-8 ---------------------------------- Ladies and Gentlemen: We have examined the Registration Statement on Form S-8 to be filed by you with the Securities and Exchange Commission on or about the date hereof (the "Registration Statement"), in connection with the registration under the Securities Act of 1933, as amended, of an aggregate of 5,694,259 shares of your Common Stock (the "Option Shares") under the 1997 Stock Plan, the 1998 Director Option Plan, the 1998 Employee Stock Purchase Plan and pursuant to the agreements between BioMarin Pharmaceutical Inc. and holders of options under the Glyko Biomedical Share Option Plan - 1994 (collectively, the "Plans"). As legal counsel to BioMarin Pharmaceutical Inc. (the "Company"), we have examined the proceedings taken and proposed to be taken in connection with the issuance, sale and payment of consideration for the Option Shares under the Plans. In addition, for the purposes of this opinion, we have assumed that the consideration received by the Company in connection with each issuance of the Option Shares will include an amount in the form of cash, services rendered or property that exceeds the greater of (i) the aggregate par value of such shares or (ii) the portion of such consideration determined by the Company's Board of Directors to be "capital" for purposes of the Delaware General Corporation Law. It is our opinion that the Option Shares, when issued and sold in the manner described in the Plans and pursuant to the agreement that accompanies each grant under the Plans will be legally and validly issued, fully paid and non-assessable. We consent to the use of this opinion as an exhibit to the Registration Statement and further consent to the use of our name wherever appearing in the Registration Statement, including any prospectus constituting a part thereof, and any amendments thereto. This opinion may be incorporated by reference in any abbreviated registration statement filed pursuant to General Instruction E of Form S-8 under the Securities Act with respect to the Registration Statement. Sincerely, WILSON SONSINI GOODRICH & ROSATI Professional Corporation /s/ Wilson Sonsini Goodrich & Rosati