The deal, in which Switzerland's biggest bank will take over the second largest, was vital to prevent economic turmoil from spreading throughout the country and beyond, the Swiss government said.
The move was welcomed in Washington, Frankfurt and London as one that would support financial stability, after a week of turbulence following the collapse of two US banks.
After a dramatic day of talks at the finance ministry in Bern -- and with the clock ticking towards the markets reopening on Monday -- the takeover was announced at a press conference.
Swiss President Alain Berset was flanked by UBS chairman Colm Kelleher and his Credit Suisse counterpart Axel Lehmann, along with the Swiss finance minister and the heads of the Swiss National Bank (SNB) and the financial regulator FINMA.
The wealthy Alpine nation is famed for its banking prominence and Berset said the takeover was the "best solution for restoring the confidence that has been lacking in the financial markets recently".
If Credit Suisse went into freefall, it would have had "incalculable consequences for the country and for international financial stability", he said.
Credit Suisse said in a statement that UBS would take it over for "a merger consideration of three billion Swiss francs ($3.25 billion)".
After suffering heavy falls on the stock market last week, Credit Suisse's share price closed Friday at 1.86 Swiss francs, with the bank worth just over $8.7 billion.
UBS said Credit Suisse shareholders would get 0.76 Swiss francs per share.
"Given recent extraordinary and unprecedented circumstances, the announced merger represents the best available outcome," Lehmann said.
Asian equities still fell in early trade Monday, with Hong Kong, Tokyo, Sydney, Seoul and Singapore all in the red.
Hong Kong's monetary authority sought to calm jitters Monday morning, saying that "exposures of the local banking sector to Credit Suisse are insignificant", as the bank's assets make up "less than 0.5 percent" of the city's banking sector.
Despite that, the city's banking stocks tumbled: HSBC dropped six percent, Standard Chartered shed five percent and Hang Seng Bank gave up nearly two percent, in line with a global sell-off in the sector on worries about lenders' exposure to bonds linked to Credit Suisse.
"Uncertainty could remain high for quite some time, even if recent bank support measures succeed," said analyst Stephen Innes of SPI Asset Management.
"Huge collateral damage" risk
Swiss Finance Minister Karin Keller-Sutter said that bankruptcy for Credit Suisse could have caused "huge collateral damage".
With the "risk of contagion" for other banks, including UBS itself, the takeover has "laid the foundation for greater stability both in Switzerland and internationally", she said.
The deal was warmly received internationally.
The decisions taken in Bern "are instrumental for restoring orderly market conditions and ensuring financial stability," said European Central Bank chief Christine Lagarde.
"The euro area banking sector is resilient, with strong capital and liquidity positions."
US Federal Reserve chair Jerome Powell and Treasury Secretary Janet Yellen said in a joint statement: "We welcome the announcements by the Swiss authorities today to support financial stability."
The sentiment was echoed by British Finance Minister Jeremy Hunt.
The Fed and the central banks of Canada, Britain, Japan, the EU and Switzerland announced they would launch a coordinated effort Monday to improve banks' access to liquidity.
The SNB announced 100 billion Swiss francs of liquidity would be available for the UBS-Credit Suisse takeover.
Keller-Sutter insisted the deal was "a commercial solution and not a bailout".
UBS chairman Kelleher said: "We are committed to making this deal a great success.
"UBS will remain rock solid."
The takeover creates a banking giant such as Switzerland has never seen before -- and raises concerns about possible layoffs.
The Swiss Bank Employees Association said there was "a great deal at stake" for the 17,000 Credit Suisse staff, plus tens of thousands of jobs outside of the banking industry potentially at risk.
Like UBS, Credit Suisse was one of 30 worldwide Global Systemically Important Banks -- deemed of such importance to the international banking system that they are colloquially called "too big to fail".
But the markets saw the bank as a weak link in the chain.
Amid fears of contagion after the collapse of two US banks, Credit Suisse's share price plunged by more than 30 percent on Wednesday to a record low of 1.55 Swiss francs. That saw the SNB step in overnight with a $54-billion lifeline.
After recovering some ground Thursday, its shares closed down eight percent on Friday at 1.86 Swiss francs, as it struggled to retain investor confidence.
In 2022, the bank suffered a net loss of $7.9 billion and expects a "substantial" pre-tax loss this year.
Credit Suisse's share price has tumbled from 12.78 Swiss francs in February 2021 due to a string of scandals that it has been unable to shake off.