Re: Registration Statement on FormS-8 of Ascendis Pharma A/S Dear Sirs We have acted as Danish counsel to Ascendis Pharma A/S (the “Company”) in connection with the registration of up to 3,557,592 ordinary shares of the Company that are available for issuance pursuant to warrants on the terms of the incentive scheme set forth in Appendix 1 to the Company’s articles of association (the “Articles of Association”) (collectively, the “Incentive Shares”). In connection with the opinion expressed herein, we have examined such documents, records and matters of law as we have deemed relevant or necessary for purposes of this opinion. Based on the foregoing, and subject to the further limitations, qualifications and assumptions set forth herein, we are of the opinion that the Incentive Shares that may be issued following exercise of the warrants have been duly authorized and, when issued in accordance with the terms of the respective warrants and against payment of due consideration therefor, will be validly issued, fully paid and non-assessable. Non-assessable shall in this context mean, in relation to a share, that the issuer of the share has no right to require the holder of the share to pay to the issuer any amount (in addition to the amount required for the share to be fully paid) solely as a result of his shareholding. The opinion expressed herein is limited to the laws of Denmark as currently in effect, and we express no opinion as to the effect of the laws of any other jurisdiction. We have assumed that the Company has taken no and will take no action inconsistent with the Danish Companies Act or the resolutions of its shareholders and its board of directors authorizing the Company to issue the warrants or the Incentive Shares. We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement on FormS-8 filed by the Company to effect registration of the Incentive Shares to be issued and sold under the Securities Act of 1933 (the “Act”). In giving |