The Australian owner of Homebase has sold the DIY chain for £1, ending its disastrous foray into the UK.
Wesfarmers paid £340m for the retailer two years ago, but losses and other costs will bring its total bill to about £1bn.
The chain is being bought by restructuring specialist Hilco, which rescued music chain HMV in 2013.
The 24 stores that had been converted to the Bunnings brand will revert to the Homebase name.
Richard Lim, of consultancy Retail Economics, said the Wesfarmers takeover had been an "unbelievable disaster" due to "woeful management decisions, clumsy execution and a misguided perception of the UK market".
He expected the restructuring would result in store closures and more job losses on the High Street. Homebase has about 250 stores and 11,500 workers.
Dave Gill, national officer at shopworkers' trade union Usdaw, said: "Staff in Homebase stores are extremely worried for the future after company's ownership changes hands yet again.
"Clearly the sale for just one pound is very disturbing. I am in touch with the company and we are seeking urgent meetings to secure jobs."
Analysis: Emma Simpson, BBC business correspondent
This must go down as one of the most disastrous retail acquisitions ever - a textbook example of how not to do it.
The Australian firm thought they could show the Brits how to do DIY. So confident, they immediately sacked Homebase's senior management team. That was a huge mistake.
They then began to strip out the soft furnishings that were popular at Homebase. Instead, Bunnings opted for no frills DIY sheds.
But it failed to understand the UK market and the losses soon started to mount. Deteriorating economic conditions certainly didn't help.
The few stores that were trading as Bunnings will convert back to the Homebase brand as this company makes an ignominious retreat. The new owners will need to act fast to stem the losses across the Homebase business, which will inevitably mean store closures and job losses ahead.
Wesfarmers has admitted making a number of "self-induced" blunders, such as underestimating winter demand for a range of items from heaters to cleaning and storage, and dropping popular kitchen and bathroom ranges.
Rob Scott, chief executive of Wesfarmers, said the UK market proved to be "very competitive", with "quite challenging" retail conditions.
Asked whether investors could trust Australia's biggest retail group with future acquisitions, he said he hoped the disposal "demonstrates the capability of our team to act decisively".
Wesfarmers expects the disposal to cost up to £230m. It will be entitled to 20% of any future sale of the business.
Homebase chief Damian McGloughlin, who will stay on as part of the management buyout funded by Hilco, "marks an exciting new chapter" for the retailer.
"With Hilco's support we have the commitment of an experienced partner, substantial additional capital, stability for the business and the opportunity to reinvigorate a brand that has been a mainstay of UK retail for over 40 years," he said.
Hilco was given a "Turnaround of the Decade" award last year for its revival of HMV.
The view from the shop floor
By Kevin Peachey, personal finance reporter
The newly branded Bunnings store in Penge, south-east London, opened its doors with some fanfare in March - including an appearance by Peppa Pig.
But now that Bunnings has failed to bring home the bacon for Wesfarmers, the store will become a Homebase once more.
Shoppers at the store seem bemused. Carpenter Paul Gainford said: "I'm a bit gutted that it is going back to Homebase. It has got everything here - things that you can't get elsewhere."
Other shoppers agreed that some ranges, such as tools and plants, had improved since the switchover. Ultimately, they were keen for the store to stay open in some form under the new ownership.
"There is not much choice around here so it is important that places like this remain," said Wayne Obee, who was buying plants and compost for his garden.
Retired banker Neil Rank, 60, was concerned about the impact on workers: "There seems to be more staff here now it is a Bunnings. But whenever costs are cut, it is staff costs that they look at first."