An emergency ordinance, a government backstop, and shareholders coming out better than some bondholders: UBS Group’s government-brokered deal to buy Credit Suisse Group is historic, complex and unique.

The first merger of two banks both deemed systemically important since the financial crisis almost 15 years ago was put together in a matter of days.

UBS is paying 3 billion francs for its battered rival in a deal aimed at avoiding a broader financial crisis. Switzerland backed the deal with a liquidity backstop, a guarantee to cover as much as 9 billion francs ($9.7 billion) of UBS’s losses, and by waiving the requirement to get shareholder approval.