Exhibit 5.2

To: UBS AG Bahnhofstrasse 45 8001 Zurich Switzerland | Homburger AG Prime Tower Hardstrasse 201 CH–8005 Zurich T +41 43 222 10 00 F +41 43 222 15 00 lawyers@homburger.ch |
Zurich, September 11, 2023
UBS AG, acting through its London branch
U.S.$ 1,000,000,000 5.800% Fixed Rate Senior Notes due 2025, U.S.$ 1,500,000,000 5.650% Fixed Rate Senior Notes due 2028 and U.S.$ 500,000,000 Floating Rate Senior Notes due 2025
We, Homburger AG, have acted as special Swiss counsel to UBS AG in connection with the issuance by UBS AG, acting through its London branch (the Issuing Branch), of (i) U.S.$ 1,000,000,000 aggregate principal amount of 5.800% Fixed Rate Senior Notes due 2025 (the 2025 Fixed Rate Notes, which expression includes, unless the context otherwise requires, the 2025 Fixed Rate Global Securities (as defined below)), (ii) U.S.$ 1,500,000,000 aggregate principal amount of 5.650% Fixed Rate Senior Notes due 2028 (the 2028 Fixed Rate Notes, which expression includes, unless the context otherwise requires, the 2028 Fixed Rate Global Securities (as defined below)), and (iii) U.S.$ 500,000,000 aggregate principal amount of Floating Rate Senior Notes due 2025 (the Floating Rate Notes, which expression includes, unless the context otherwise requires, the Floating Rate Global Security (as defined below) and, together with the 2025 Fixed Rate Notes and the 2028 Fixed Rate Notes, the Notes), under the Indenture dated as of June 12, 2015 (the Base Indenture), between UBS AG and U.S. Bank Trust National Association, as trustee (the Trustee), as supplemented by (x) in the case of the 2025 Fixed Rate Notes, the Supplemental Indenture relating to the 2025 Fixed Rate Notes, dated as of September 11, 2023 (the 2025 Fixed Rate Note Supplemental Indenture), (y) in the case of the 2028 Fixed Rate Notes, the Supplemental Indenture relating to the 2028 Fixed Rate Notes, dated as of September 11, 2023 (the 2028 Fixed Rate Note Supplemental Indenture), and (z) in the case of the Floating Rate Notes, the Supplemental Indenture relating to the Floating Rate Notes, dated as of September 11, 2023 (the Floating Rate Note Supplemental Indenture and, together with the 2025 Fixed Rate Note Supplemental Indenture and the 2028 Fixed Rate Note Supplemental Indenture, the Supplemental Indentures), in each case between UBS AG, acting through the Issuing Branch, and the Trustee. As such special Swiss counsel, we have been requested to give our opinion as to certain matters of Swiss law relating to the Notes.

This opinion is confined to and given on the basis of the laws of Switzerland in force at the date hereof. Such laws and the interpretation thereof are subject to change. This opinion is also confined to the matters stated herein and the Documents (as defined below), and is not to be read as extending, by implication or otherwise, to any agreement or other document referred to in any of the Documents (including, in the case of the Prospectus, any document incorporated by reference therein or exhibited thereto) or any other matter.
For purposes of this opinion, we have not conducted any due diligence or similar investigation as to factual circumstances that are or may be referred to in the Documents, and we express no opinion as to the accuracy of representations and warranties of facts set out in the Documents or the factual background assumed therein.
For purposes of this opinion, we have only reviewed the following documents (collectively, the Documents):
| (i) | an electronic copy of the executed Base Indenture; |
| (ii) | an electronic copy of the executed 2025 Fixed Rate Note Supplemental Indenture; |
| (iii) | an electronic copy of the executed 2028 Fixed Rate Note Supplemental Indenture; |
| (iv) | an electronic copy of the executed Floating Rate Note Supplemental Indenture; |
| (v) | an electronic copy of the (A) two global securities representing the 2025 Fixed Rate Notes (the 2025 Fixed Rate Global Securities), (B) three global securities representing the 2028 Fixed Rate Notes (the 2028 Fixed Rate Global Securities), and (C) one global security representing the Floating Rate Notes (the Floating Rate Global Security and, together with the 2025 Fixed Rate Global Securities and the 2028 Fixed Rate Global Securities, the Global Securities), in each case executed by UBS AG, acting through the Issuing Branch; |
| (vi) | an electronic copy of the executed Underwriting Agreement relating to the Notes, dated September 5, 2023 (together with the Base Indenture, the Supplemental Indentures and the Notes, the Transaction Agreements), among UBS AG, acting through the Issuing Branch, UBS Securities LLC, as representative of the several Underwriters named in Schedule I thereto, and UBS AG London Branch, as UK Manufacturer (as defined therein); |
| (vii) | an electronic copy of the prospectus dated May 27, 2022 (the Base Prospectus); |
| (viii) | an electronic copy of the prospectus supplement to the Base Prospectus, dated September 5, 2023 (together with the Base Prospectus, the Prospectus, and together with the Transaction Agreements, the Transaction Documents); |

| (ix) | a copy of the articles of association (Statuten) of UBS AG in their version dated April 4, 2023, certified by the Commercial Register of the Canton of Zurich (the Articles); |
| (x) | a certified excerpt from the Commercial Register of the Canton of Zurich for UBS AG, dated September 7, 2023 (the Excerpt); |
| (xi) | an electronic copy of the approval of the Group Treasurer and the Group Chief Financial Officer of UBS Group, dated June 12, 2015, and relating to the Base Indenture (the 2015 Approval); |
| (xii) | an electronic copy of the resolutions of the Group Treasurer and the Group Chief Financial Officer of UBS Group, dated January 26, 2022, and relating to, among other things, the registration statement on Form F-3 (the Registration Statement) of which the Prospectus forms a part (the 2022 Approval); |
| (xiii) | an electronic copy of the resolutions of the Group Treasurer and the Head of Capital Management of UBS Group, dated August 31, 2023, which amended and restated Schedule 1 to the 2022 Approval (the Amendment); |
| (xiv) | an electronic copy of the approval of the Group Treasurer of UBS Group, approving the issuance of the Notes, dated September 1, 2023, including the term sheets for the Notes attached thereto (the Issuance Approval); |
| (xv) | an electronic copy of the final term sheets for the Notes, signed by the Group Treasurer of UBS Group on September 6, 2023 (together with the 2015 Approval, the 2022 Approval and the Issuance Approval, the Approvals); |
| (xvi) | an electronic copy of the Organizational Regulations of UBS Group AG and UBS AG, valid as of November 26, 2014, including the annexes thereto (the 2014 Regulations); |
| (xvii) | an electronic copy of the Organizational Regulations of UBS AG, valid as of April 1, 2020, including the annexes thereto (the 2020 Regulations); |
| (xviii) | an electronic copy of the Organizational Regulations of UBS AG, valid as of June 12, 2023, including the annexes thereto (the 2023 Regulations); |
| (xix) | an electronic copy of the UBS Delegation of Authorities Group Finance (including Group Treasury) 9-C-011610 in its version effective as of August 29, 2023 (the Delegation of Authorities); |
| (xx) | an electronic copy of the Policy on Signing Authority 1-P-000052 in its version published on April 19, 2023 (the Signing Authority); and |
| (xxi) | an electronic copy of the list of authorized signatories relating to notes registered with the U.S. Securities and Exchange Commission, executed by two directors of UBS AG on August 22, 2023 (the List of Authorized Signatories). |

No documents have been reviewed by us in connection with this opinion other than the Documents. Accordingly, we shall limit our opinion to the Documents and their legal implications under the laws of Switzerland.
In this opinion, Swiss legal concepts are expressed in English terms and not in their original language. These concepts may not be identical to the concepts described by the same English terms as they exist under the laws of other jurisdictions. With respect to Documents governed by laws other than the laws of Switzerland, for purposes of this opinion, we have relied on the plain meaning of the words and expressions contained therein without regard to any import they may have under the relevant governing law.
In rendering the opinions below, we have assumed the following:
| (a) | all documents produced to us as originals are authentic and complete, and all documents produced to us as copies (including, without limitation, fax and electronic copies) conform to the original; |
| (b) | all documents produced to us as originals and the originals of all documents produced to us as copies were duly executed and certified, as applicable, by the individuals purported to have executed or certified, as the case may be, such documents, and any electronic signature on behalf of UBS AG (whether or not acting through the Issuing Branch) on any such document has been affixed thereto by the individual to whom such electronic signature belongs and such individual has saved and submitted such document as so electronically signed in such a manner so as to prevent removal or other alteration of such signature; |
| (c) | except as expressly opined upon herein, all information contained in the Documents is, and all material statements made to us in connection with the Documents are, true and accurate; |
| (d) | the Excerpt is correct, complete and up-to-date, and the Articles, the 2023 Regulations, Delegation of Authorities, the Approvals, the Signing Authority and the List of Authorized Signatories have not been amended (other than, in the case of the 2022 Approval, by the Amendment) and are in full force and effect; |
| (e) | as at the date of the 2022 Approval, the 2020 Regulations had not been amended and were in full force and effect; |
| (f) | as at the date of the 2015 Approval, the 2014 Regulations had not been amended and were in full force and effect; |
| (g) | immediately after giving effect to the issuance of the Notes, the aggregate issuance amount, as measured by the aggregate initial public offering price, of all the securities (including the Notes) issued and sold pursuant to the 2022 Approval will not exceed U.S.$ 35,000,000,000 or the equivalent in such foreign currencies or units of two or more currencies (based on the applicable rate at the time of offering), as determined in accordance with the 2022 Approval; and |

| (h) | each Transaction Agreement continues in full force and effect and has not been amended (other than, in the case of the Base Indenture, by the Supplemental Indentures and any supplements thereto relating to individual note issuances thereunder that do not constitute Notes). |
Based on the foregoing and subject to the qualifications set out below, we are of the opinion that:
| 1. | UBS AG is a corporation (Aktiengesellschaft) duly incorporated and validly existing under the laws of Switzerland. |
| 2. | UBS AG has the corporate power and authority to (a) execute and deliver the Supplemental Indentures and (b) issue the Notes, in each case acting through the Issuing Branch. |
| 3. | UBS AG has taken all necessary corporate action to authorize (a) the execution and delivery the Supplemental Indentures and the Notes and (b) the issuance of the Notes, in each case by UBS AG, acting through the Issuing Branch. |
| 4. | The Supplemental Indentures and the Notes have been duly executed and delivered by UBS AG, acting through the Issuing Branch. |
| 5. | The Base Indenture was duly authorized, executed and delivered by UBS AG. |
The above opinions are subject to the following qualifications:
| (a) | The lawyers of our firm are members of the Zurich bar and do not hold themselves out to be experts in any laws other than the laws of Switzerland. Accordingly, we are opining herein as to Swiss law only, based on our independent professional judgment, and we express no opinion with respect to the applicability or the effect of the laws of any other jurisdiction to or on the matters covered herein. |
| (b) | We express no opinion on the legality, validity or enforceability of any of the provisions of the Base Indenture, the Supplemental Indentures or the Notes or the performance of the obligations assumed by UBS AG thereunder. |
| (c) | We express no opinion as to the accuracy or completeness of the information set out in the Prospectus. |
| (d) | We express no opinion on the admissibility or validity of, or the procedures relating to, the registration of the offering of the Notes with the SEC. |
| (e) | Further, we express no opinion as to banking regulatory matters or as to any commercial, accounting, calculating, auditing or other non-legal matter. Also, we express no opinion as to tax matters. |

* * *
We have issued this opinion as of the date hereof and we assume no obligation to advise you of any changes in fact or in law that are made or brought to our attention hereafter.
We hereby consent to the filing of this opinion with the SEC as an exhibit to a Form 6-K to be incorporated by reference into the Registration Statement and to the use of our name in the prospectus included in the Registration Statement under the heading "Legal Matters". In giving such consent we do not admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act.
This opinion is furnished by us, as special Swiss counsel to UBS AG, in connection with the the issuance of the Notes, except as provided in the immediately preceding paragraph, is not to be used, circulated, quoted or otherwise referred to for any other purpose without our express written permission, or relied upon by any other person.
This opinion is governed by and shall be construed in accordance with the laws of Switzerland. We confirm our understanding that all disputes arising out of or in connection with this opinion shall be subject to the exclusive jurisdiction of the courts of the Canton of Zurich, Switzerland, venue being the City of Zurich.
Sincerely yours,
/s/ HOMBURGER AG