"Every transaction has its fun and games, but this was certainly one of the most challenging of my career," says National Grid deputy general counsel Mark Noble (pictured).

The deal he is referring to is the mammoth separation and sale of National Grid's gas distribution network, which resulted in a winning bid last December by a consortium of international investors including Australian investment bank Macquarie, the Qatar Investment Authority and Chinese sovereign wealth fund CIC.

The deal, which values the gas distribution division at £13.8bn, will see National Grid sell a 61% stake in 130,000km of UK gas pipelines to the consortium and, following completion, return £4bn of net proceeds to shareholders.

Noble, who started his career at what he calls 'Grid' in 2000, has worked on more than a few high profile deals during his 16 years at the company, including the European Investment Bank's £1.5bn investment in its electricity transmission network in 2014. However, this latest deal presented unique challenges, with an array of expertise in a variety of practice areas needing to be deployed in a very short timeframe.

Noble comments: "It had a complex business separation, a massive finance piece; it had a sale process… we are obviously still a shareholder in the business, and once we close the transaction this deal has got a very substantial return of capital. From a legal perspective, there aren't many boxes left untouched in this process."

The size and complexity of the separation is illustrated by Noble's observation that if you were to list the newly separated business, you would have a FTSE 50 company by market capitalisation. With National Grid's in-house team counting just 35 people, it was clear from the outset that the company's external panel would need to be called upon for a job of this magnitude.

Law firms were appointed after a series of mini-tenders were sent out to panel members. Linklaters was picked to lead on the separation, with Eversheds assisting. A property sub-panel was put together, coordinated by Addleshaw Goddard and featuring Eversheds, DLA Piper and Irwin Mitchell. Dentons provided gas regulation advice, with Shakespeare Martineau handling metering work.

Linklaters' first task was to look at the separation of the gas business. The firm assembled a team led by corporate partner Roger Barron alongside corporate and infrastructure partner Jessamy Gallagher. The separation was in itself a huge task, as Barron illustrates: "This was a business that had been sitting in the company since privatisation, so there was a lot of history associated with it. As a result, the legal process was front and centre of preparing for sale."

A decision was made early on to publicise the deal, which along with it being a very attractive asset, prompted much interest from potential purchasers. An auction process was therefore felt to be the best method of finding a buyer.

"The challenge for the team was to execute the separation on the legal side and then turn around and go straight into the M&A process," says Gallagher. The auction process, which took around nine months, finally resulted in the winning bid by a consortium of eight investors, which were advised by Clifford Chance, CMS and Cleary Gottlieb Steen & Hamilton.

This is a great example of a really large-scale transaction where the technology was at the centre of it all

However, the results of the bid propelled the deal into the headlines, in part due to concerns that more key UK infrastructure would now be under the control of foreign investors. This, coupled with much political uncertainty in the year of Brexit and Trump, made it a particularly difficult deal to wield.

However, as Noble comments: "Of course, like many others we had to consider whether the Brexit vote might impact any aspect of what we were doing. In the end we decided that the transaction remained on track, and in fact there were certain market conditions that worked to our advantage – including being able to issue the largest sterling-denominated bond in the UK by a corporate."

One key factor that helped navigate complex aspects of the deal was the use of technology. As Gallagher says: "This is a great example of a really large-scale transaction where the technology was at the centre of it all."

Barron adds: "One of the first things that Mark said to me was that we need to make the technology work on this. So we sat down with our team, the other firms and Mark, and said: 'Right, here are the ways in which we can analyse, sift through and report and communicate'."

One of the pieces of software that was heavily used during the deal was HighQ, which enabled Eversheds and Linklaters lawyers to share information, create secure extranets and more efficiently support project management.

The HighQ tool was deployed to deal with the 13,000 properties contained within the deal, and allowed the team to more effectively manage more than 1,000 contracts.

Gallagher says: "HighQ meant that it much easier to work collaboratively. We had to produce some really large due diligence reports for both external and internal use – to be able to do that all through one platform saved a huge amount of time and money."

Other technology deployed included Dealmaster, which also made collaboration much easier – particularly for due diligence – by enabling all parties to access summaries, analyse contracts and input suggestions.

Although the deal still requires final approval from European regulators, Barron describes the moment in November when the deal was signed.

"The in-house team, Mark's commercial colleagues and of course each member of the consortium and their lawyers were all here with us on the night of signing. I looked down the long Silk Street corridor to see all the parties that had been working together, and really sensed that an M&A transaction of this size and complexity was an achievement for all of us."