Exhibit 5.1 May 21, 2001 BioMarin Pharmaceutical Inc. 371 Bel Marin Keys Boulevard, Suite 210 Novato, California 94949 Ladies and Gentlemen: We are furnishing this opinion of counsel to BioMarin Pharmaceutical Inc., a Delaware corporation (the "Company") for filing as Exhibit 5.1 to the Registration Statement on Form S-3 (the "Registration Statement") to be filed by the Company with the Securities and Exchange Commission under the Securities Act of 1933, as amended, relating to the resale of up to 5,621,960 shares (the "Shares") of its Common Stock, $.001 par value per share. We have examined the certificate of incorporation and bylaws, each as amended to date, of the Company, and the originals, or copies certified or otherwise identified, of records of corporate action of the Company as furnished to us by the Company, certificates of public officials and of representatives of the Company, and such other instruments and documents as we deemed necessary, as a basis for the opinions hereinafter expressed. In such examination we have assumed the genuineness of all signatures, the authenticity of all corporate records and other documents submitted to us and the conformity to original documents submitted to us as certified or photostatic copies. Based upon our examination as aforesaid, and in reliance upon our examination of such questions of law as we deem relevant under the circumstances, we are of the opinion that the Shares, when purchased and issued as described in the Registration Statement, will be validly issued, fully paid and nonassessable. We express no opinion with respect to the applicability or effect of the laws of any jurisdiction other than the Delaware General Corporation Law, as in effect as of the date hereof. We hereby consent to the filing of this opinion of counsel as Exhibit 5.1 to the Registration Statement and to the reference to our firm under the caption "Legal Matters." Very truly yours, /s/ PAUL, HASTINGS, JANOFSKY & WALKER LLP