THE markets were convinced it wouldn't happen.

Most of the media were convinced it wouldn't happen. Even the men who pulled it off had been insisting a few months earlier that it wouldn't happen. But at three o'clock last Monday morning at the London offices of law firm Herbert Smith Freehills, a couple of blocks from Shoreditch tube station, it mattered not. The pens of the two teams of advisers and lawyers were finally ready to go to put signatures in the relevant places. As the rest of the world would discover at the stroke of seven when the stock market opened, Aberdeen Asset Management had just pulled off the big one.

Dead in the water a decade earlier, barely out of shorts compared to most of its venerable peers, headquartered in a city with no other pedigree in financial services, it had just become the biggest independent fund manager in Europe.

Aberdeen might still have to convince some sceptics that its £560 million deal to buy Edinburgh-based Scottish Widows Investment Partnership (SWIP) from Lloyds Banking Group is the right move for the company, but there is certainly no questioning the scale of its ambition.

This story dates back to 1999, the year when Lloyds bought insurance group Scottish Widows for £7 billion. That was the era when bancassurance (bringing together banking and insurance to offer benefits to customers that were supposed to unlock new and faster profit growth for the holding companies) was all the rage.

On the back of the deal, Lloyds' asset management businesses Hill Samuel and Lloyds TSB Life were moved from London to Edinburgh to be combined with Widows' in-house investment management operation. So SWIP was born, with a brief to tout for outside business for the first time and build a new asset management stronghold in the Scottish capital.

However, it became increasingly clear during the noughties that there was a clash of cultures between retail banks and fund management operations. Where one is supposed to take deposits and lend money while avoiding undue risks, the other needs to take risks to produce the returns for its clients. Even in an era when banks badly lost sight of this core purpose, many argue that it still coloured how their asset management departments were seen by investors and their advisers.

Neither was it a particularly easy sell for insurance companies to move beyond the very low-risk asset management they had traditionally practised with the incomes of their policy and pension holders. This reputedly had much to do with why chief investment officer Sandy Nairn and retail fund head Graham Campbell quit SWIP in 2003 to set up Edinburgh Partners, starting a trend that unfortunately kept recurring.

According to one former SWIP investment manager, this growing perception of a bad fit created a "constant fear of being sold" among the intermediary advisers whose recommendations to investors and fundholders are crucial for determining which fund managers get new business.

"If you were good and were trying to sell your fund, intermediaries would say they would rather do business with someone who's only quite good somewhere else. So the very successful European equity desk left to work at BlackRock, where they have gone on to be very successful.

"The global emerging markets desk moved to Martin Currie and are doing very well. They found that SWIP was holding them back."

In turn this exodus damaged perceptions further. Amanda Forsyth of Murray Asset Management says: "The reason so many funds have been exiting is because there has been a rapid turnover of people managing the funds. The revolving door has been revolving rapidly, mostly in an outward direction."

And all this was before Gordon Brown's fateful conversation with then-Lloyds chairman Sir Victor Blank about taking over HBOS at that notorious cocktail party at London's Spencer House in September 2008.

As it became ever clearer that this was one of the most disastrous banking takeovers of all time, the shockwaves were felt in every corner of the Lloyds empire.

The previous source says: "The whole emphasis was now about not taking risks, not making mistakes. The culture became much more top-down. The presence of HR and compliance became a lot stronger. The way that people were appraised became much more centralised. It became an irritation for staff."

Constantly ringing in their ears was speculation that Scottish Widows and/or SWIP would be off-loaded as Lloyds battled to stay solvent.

Not surprisingly in this climate the performance was not brilliant, even if there were still some strong pockets, notably bonds. SWIP's assets under management were around £100bn in 2007, just before current boss Dean Buckley took over.

T His is now £136bn, but only thanks to Lloyds' decision to merge it with part of HBOS's equivalent Insight business, which brought assets of about £50bn to the table. Admittedly the business has become rather more profitable in the past six years, but it shows what investment managers have been up against.

At the same time, a number of the stock market-focused funds have under-performed. There was consequently a night of the long knives in April 2012, where SWIP axed 23 of its 150 fund managers on the so-called equities side.

By and large their operations were replaced by computer-modelled investment processes, known as quantitative investing. These are spurned by some investment houses, including Aberdeen, but are seen by others as a safer way of producing stable returns.

By that time, Lloyds was trying to sell the business. Sources at Aberdeen confirm that senior managers attended an exploratory meeting well over a year ago.

When Lloyds' sale process for SWIP became more official in the spring of this year, there was talk of various big US players sniffing around, including New York house Ameriprise, and a price tag of £800m.

Aberdeen chief executive Martin Gilbert was quick to rule his firm out, insisting the focus was organic growth and bolt-on acquisitions. However, his position changed after more meetings in the summer when Lloyds and its advisers, Deutsche Bank, indicated that the original lot was being widened.

It would now include Investment Solutions, which designs products and investment strategies for customers; and an exclusive tie-in with high-end private banking division Lloyds Wealth. With Lloyds evidently struggling to do a deal, it also became clear that it would move on price.

Aberdeen made an offer in the early autumn. It went public with its interest in late October, sending the share price up by nearly 40p to around £4.60. But then word leaked that Australian bank Macquarie had made a cash offer of £600m. This seemed likely to trump Aberdeen's offer of around £560m in shares with a future cash payout based on performance of up to £100m, especially when it became clear that Gilbert was not planning to go higher.

The 58-year-old might have come out on top in any number of deal negotiations over the years, but by the second week of November the share price had sunk lower than it had ever risen - evidently the markets thought Macquarie had won. This would have been dire news for Edinburgh, since most of SWIP's activities would probably have ended up being relocated elsewhere.

Yet Gilbert and some other executives had already secretly met with Lloyds boss António Horta-Osório in central London a week earlier to finalise terms. Osório was attracted to the fact that the Aberdeen deal meant Lloyds becoming a 9.9% shareholder, believing that the ageing population and their demand for investment products meant the bank should not exit the sector altogether. Having ended on a handshake, the path was cleared for the teams on both sides to thrash out the small print.

Not only does the deal make Aberdeen easily the biggest independent investment manager in Europe with funds under management of £336bn (way ahead of new number two Schroders' £247bn), it is now the sixth-biggest in the world. It also means that Edinburgh moves from being its third-most important investment centre behind London and Singapore to become its largest.

The deal was welcomed by many analysts, since SWIP's strength in UK and European shares and bonds strongly diversifies Aberdeen away from its ­longstanding over-reliance on Asian and emerging markets products. These specialisms were major pluses following the crash but put some of those funds under pressure this summer after widespread speculation that the US Federal Reserve would ease off on quantitative easing (which proved incorrect).

Analysts have also said that the deal will increase Aberdeen's credibility as an alternative to US giants such as Pimco and BlackRock (albeit their funds run to trillions of dollars), while an eight-year strategic relationship with Lloyds will see its products marketed to all types of the bank's customers. Bringing together Aberdeen and SWIP is also expected to enable the firm to increase SWIP's bottom-line profit margins from an already very high 35% up to 55%.

The case for the downside is mainly about the real value of SWIP. A huge amount of it is just the investment part of Scottish Widows' insurance book, which is low risk, low fee and lacks the potential for change. And of the 16% that manages money external to Lloyds, about half of the funds are closed to new business, which almost guarantees continuing decline. In short, some observers struggle to see how Aberdeen can grow what it has bought.

As Amanda Forsyth says: "The question for Aberdeen investors is, is it really just a case of Aberdeen trying to scale up even further?"

There is also the question of whether increasing exposure to the UK and Europe is a good idea. Their economies might have turned upwards lately, but their fundamental debt positions are still very weak.

Yet the 15% boost to Aberdeen's share price after the deal was announced indicates that the markets are squarely on its side. Gilbert and his people have integrated so many businesses in the past that most people are clearly looking on the bright side. At the very least it will go down as one of the great milestones in the Aberdeen story.

Above all, no-one is making comparisons with Fred Goodwin, the last major dealmaker to build an empire in the shadow of the castle rock. For the sake of Scotland's battered financial services reputation, cross your fingers that it stays that way.