UBS Group AG (UBSG.S) was rushed into buying cross-town rival Credit Suisse Group AG (CSGN.S) in a deal it did not want, as a global bank crisis worsened the latter’s finances and prompted authorities to take swift action, a regulatory filing showed.

UBS, in a Tuesday filing to the US Securities and Exchange Commission, told investors it had less than four days to conduct due diligence given the “emergency circumstances”.

It estimated a hit of about $17 billion from the takeover.

Switzerland’s biggest bank agreed to buy its smaller rival after the latter had endured a difficult year.

Credit Suisse’s involvement in a series of corporate collapses spooked clients who began withdrawing their money, a trend that accelerated when US bank failures sparked fear of a broader banking crisis.

The wave of deposit outflows and a major share-price drop prompted Switzerland’s central bank on March 15 to offer Credit Suisse liquidity assistance.

The next day, UBS and Credit Suisse signed a confidentiality agreement upon which the former began due diligence, the UBS filing showed.

On March 19, the Swiss National Bank announced UBS would buy Credit Suisse for 3 billion Swiss francs ($3.4 billion) in stock and assume a loss of as much as 5 billion francs stemming from winding down part of the business.

The final price was raised from an initial 1 billion francs, the filing showed.

Interest from UBS in buying Credit Suisse began in October when the ad hoc Strategy Committee of its board of directors reviewed its rival’s distressed situation, according to the filing.

By then, Credit Suisse was experiencing deposit and net asset outflows at levels substantially exceeding rates of the July-September quarter, UBS said.

In early December, UBS management undertook a preliminary assessment of the consequences of a Credit Suisse purchase, which it presented to the Strategy Committee on Dec. 19.

In February, the Strategy Committee and board of directors each concluded an acquisition was “not desirable” and recommended further analysis to prepare for a scenario in which Credit Suisse was in such difficulty that regulators could ask UBS to step in.

UBS said it carried out financial analyses from January to mid-March and assessed potential legal structures and possible measures to address concerns, as well as any negative impact to itself, in case authorities proposed an acquisition.

From December to mid-January, Credit Suisse executives had also been discussing with the government about its options including a merger with UBS, the UBS filing showed.