HBOS is the biggest mortgage lender in the UK
Lloyds TSB is to take over HBOS in a £12bn deal which will create a banking giant holding close to one-third of the UK's savings and mortgage market.
The firms' boards agreed on Wednesday to a deal, to be formally announced later, valuing HBOS at 232p per share.
The move should calm uncertainty about the strength of Halifax Bank of Scotland after a run on its shares.
HBOS is currently the country's largest mortgage lender with 20% of the market. Lloyds ranks fourth with an 8% share.
Details emerged late on Wednesday after a day during which HBOS shares had fluctuated wildly on the London market, climbing as high as 220p and falling as low as 88p.
Shares in the lender eventually closed 19% lower at 147.10p, while Lloyds shares ended unchanged at 279.75p.
The development comes as the credit crunch has wreaked havoc on some of the world's biggest financial institutions in recent days:
- Barclays Bank is to buy some Lehman Brothers assets after the fourth-largest US investment bank filed for bankruptcy protection, dealing a blow to the fragile global financial system.
- The US Treasury stepped in with an $85bn (£48bn) rescue package to bail out insurance giant AIG amid fears the group, once the world's largest insurer, could face collapse.
- Bank of America bought Merrill Lynch in a $50bn deal - making it the third top US investment bank to fall prey to the sub-prime crisis within six months.
- In Russia, trading on the country's main stock exchanges was halted after steep falls this week.
- In the UK, figures released on Wednesday showed unemployment rising once again as the number of job vacancies fell.
BBC business editor Robert Peston said the government had opted to push through the Lloyds TSB-HBOS tie-up after HBOS voiced concerns that depositors and lenders had begun to withdraw their credit from the bank.
LLOYDS vs HBOS
Branches - Lloyds 1,900; HBOS 1,100
Customers - Lloyds 16 million; HBOS 22 million
Employees - Lloyds 70,000; HBOS 72,000
Savings - Lloyds is the UK's fourth largest savings provider; HBOS is the market leader
Retail savings balance - Lloyds £65bn; HBOS £139bn
"There were growing concerns in the HBOS boardroom that a climate of fear was being created about its future that could have led to a funding crisis, or a Northern Rock-style run - on steroids," he said.
The deal was negotiated at the very highest level, with Prime Minister Gordon Brown telling Lloyds TSB chairman Sir Victor Blank that it would be helpful if Lloyds could end the uncertainty surrounding HBOS by buying it.
"It was not in the government's interest for there to be the faintest risk that it would have another Northern Rock on its hands," our business editor added.
He said this transaction, which will create a giant firm with 22 million customers, was truly exceptional in its scale and would not usually be allowed.
"It's the kind of the deal that ministers would normally expect the competition watchdogs to block," he said.
"But on this occasion they are using a national interest clause in competition law to override any objections the watchdogs would have," he explained.
The government supported such a deal because any failure of HBOS would have such a damaging impact on the UK.
Richard Lambert, the CBI's director-general said: "This looks like the right outcome. Lloyds TSB is a strong, well capitalised institution, and the new entity will be well placed to withstand the current turbulence.
"The last thing we want is a sharp contraction of bank balance sheets because of the impact it would have on the availability of credit."
While the deal should reassure HBOS savers, there is some anxiety about the power the merged banks will have.
Ray Boulger, of John Charcol, said the deal would mean less competition and therefore reduced choice for consumers.
Following the takeover, Lloyds chief executive Eric Daniels is expected to take the helm of the enlarged group, with the future of HBOS chief Andy Hornby unclear.