EXHIBIT 5.1 October 31, 1996 Triangle Pharmaceuticals, Inc. 4 University Place 4611 University Drive Durham, North Carolina 27707 Re: TRIANGLE PHARMACEUTICALS, INC. REGISTRATION STATEMENT ON FORM S-8 FOR OFFERING OF 2,182,667 SHARES OF COMMON STOCK Ladies and Gentlemen: In connection with the registration of 2,182,667 shares of the Common Stock of Triangle Pharmaceuticals, Inc. (the "Company") under the Company's 1996 Stock Incentive Plan and Employee Stock Purchase Plan on Form S-8 (the "Registration Statement") under the Securities Act of 1933, as amended, we advise you that, in our opinion, if and when such shares have been issued and sold pursuant to the provisions of the Company's 1996 Stock Incentive Plan or Employee Stock Purchase Plan and in accordance with the Registration Statement, such shares will be duly-authorized, validly-issued, fully-paid and non-assessable shares of the Company's Common Stock. We hereby consent to the use of this opinion as an exhibit to the Registration Statement and further consent to all references to us in the Registration Statement and any further amendments thereto. Subject to the foregoing sentence, this opinion is given as of the date hereof solely for your benefit and may not be relied upon, circulated, quoted or otherwise referred to for any purpose without our prior written consent. Very truly yours, /s/ BROBECK, PHLEGER & HARRISON LLP BROBECK, PHLEGER & HARRISON LLP