Sunday's announcement came after a weekend of emergency talks in Switzerland between the two banks and the country's financial regulators.
The Swiss National Bank said the deal was the best way to restore the confidence of financial markets and to manage risks to the economy.
Credit Suisse said it was not expecting "any disruption to client services".
"We are fully focused on ensuring a smooth transition and seamless experience for our valued clients and customers," a spokesperson for the bank told the BBC.
Credit Suisse shareholders were deprived of a vote on the deal and will receive one share in UBS for every 22.48 shares they own, valuing the bank at $3.15bn (£2.6bn).
At the close of business on Friday Credit Suisse was valued at around $8bn.
But the deal has achieved what regulators set out to do - secure a result before the financial markets opened on Monday.
The chairmen of both banks spoke at a news conference in Bern on Sunday
In a statement Switzerland's central bank said "a solution has been found to secure financial stability and protect the Swiss economy in this exceptional situation".
The federal government said in order to reduce any risks for UBS it would grant a guarantee against potential losses worth $9.6bn.
The Swiss central bank has also offered liquidity assistance of up to $110bn.
Global financial institutions were quick to praise the deal.The Bank of England said it welcomed the "comprehensive set of actions" set out by the Swiss authorities.
"We have been engaging closely with international counterparts throughout the preparations for today's announcements and will continue to support their implementation."
It said the UK banking system was "well capitalised and funded, and remains safe and sound".The UK Treasury also said it welcomed the merger and the British government would continue to engage with the Financial Conduct Authority (FCA) and the Bank of England "as is usual".
The FCA said on Sunday it was "minded to approve" the takeover to support financial stability as both UBS and Credit Suisse have operations in London.
"The FCA continues to engage closely with UK and international regulatory partners to monitor market developments," the watchdog said.
Christine Lagarde, President of the European Central Bank, said she welcomed the "swift action" of the Swiss authorities.
"They are instrumental for restoring orderly market conditions and ensuring financial stability.
"The euro area banking sector is resilient, with strong capital and liquidity positions," Ms Lagarde said.
The comments from the European Central Bank President were echoed in the US.
Treasury Secretary Janet Yellen and Federal Reserve Board chairman Jerome Powell both said the announcement by the Swiss authorities supported "financial stability".
"The capital and liquidity positions of the US banking system are strong, and the US financial system is resilient", they said.
Credit Suisse has become the latest and most important casualty of a crisis of confidence that has already seen the failure of two mid-sized US banks and an emergency industry whip-round for another. But this is different. Switzerland's second biggest lender was considered one of the top 30 most important banks in the world - which is why this takeover was rushed through by the Swiss authorities.
Although the reasons for each failure differ slightly, the main factor has been a sharp rise in global interest rates which has hit the value of even safe investments that banks keep some of their money in. That has spooked investors and seen the share prices of all banks fall with those considered weakest hit hardest.
The financial authorities in the EU, US and UK are saying they support this deal, stressing that banks are strong and people's savings and deposits are safe. The acid test as to whether this Swiss rescue has calmed nerves in the financial world will be when financial markets open on Monday - which is why it was so important to get this done on Sunday night.
Speaking in the Swiss capital Bern following Sunday night's announcement, UBS chairman Colm Kelleher said Credit Suisse was a "very fine asset we are determined to keep".
"This acquisition is attractive for UBS shareholders but, let us be clear, as far as Credit Suisse is concerned, this is an emergency rescue," he added.
Mr Kelleher said UBS would be running down the investment banking part of Credit Suisse.
The UBS chairman said it was "too early" to say what would happen about jobs: "We need to do this in a rational way thoughtfully, when we've sat down and analysed what we need to do," he said.
The weekend deal comes after an emergency $54bn lifeline from the Swiss National Bank on Wednesday failed to reassure markets and Credit Suisse shares tumbled 24%, prompting a wider sell-off on European markets.
The 167-year-old bank is loss-making and has faced a string of problems in recent years, including money laundering charges.