The deal, aimed at containing a crisis of confidence that threatened to spread across global financial markets, came after a hectic day of negotiations between the two lenders.
The two largest banks in the wealthy Alpine nation famed for its banking prominence have been in negotiations throughout the weekend, with the government, the central bank and financial regulators all involved.
A deal value was not immediately clear. A report in the Financial Times earlier put it at more than $2 billion.
Swiss regulators have been forced to step in and orchestrate a deal to prevent a crisis of confidence in Credit Suisse spilling over into the broader financial system.
The Swiss finance minister said the bankruptcy of a globally important bank would have created irreparable consequences for financial markets.
It was not yet clear if the deal is enough to restore trust in lenders around the world. The first indication could come when stock markets open in a few hours in Asia, Australia and New Zealand.
The Swiss central bank will supply substantial liquidity to the merged bank, it said at a news conference in the Swiss capital, Bern. It said the deal includes 100 billion Swiss francs ($108 billion) in liquidity assistance for UBS and Credit Suisse.
“With the takeover of Credit Suisse by UBS, a solution has been found to secure financial stability and protect the Swiss economy in this exceptional situation,” the Swiss central bank said.
(With inputs from agencies)