BT has sealed a deal to legally separate its network unit, Openreach, from the rest of the company, laying the ground for a boost in investment in Britain’s broadband infrastructure that will deliver better reliability and faster connections.

After two years of fraught negotiations with the industry regulator Ofcom, BT has agreed to transfer 32,000 staff to a subsidiary with its own board and control of the network.

The agreement helps brings to an end an extended period of uncertainty for BT and its shareholders. The company’s stock was up more than 4pc in morning trading as the City expressed relief that years of potential legal wrangling had been avoided. Analysts at Barclays said it was a “clear positive” for the company, which has also been battered this year by a profit warning and accounting scandal in Italy.

Openreach will now enter discussions with its biggest wholesale customers, which include Sky and TalkTalk as well as BT’s own retail unit. These operators will now push for new investment plans to include wider deployment of full fibre optic connections to replace ageing copper telephone lines.