British Sky Broadcasting Group (BSkyB) has agreed to acquire the UK broadband and fixed-line businesses of Spain's Telefonica in a deal that will make BSkyB the second-largest provider of broadband in the UK.

Under the terms of the deal, BSkyB will pay £180m (€209m, $272m) to Telefónica UK for the consumer broadband, home phone and line rental customers served by the O2 and BE brands. An amount of up to £20m will also be paid, once Telefónica customers migrate to Sky.

The deal will enlarge Sky's broadband subscriber base to 4.7 million from 4.2 million at the end of 2012, making it the second-largest provider of broadband after BT, which has 6.6 million customers.

Sky will overtake Virgin Media, which has 4.5 million customers, by adding 500,000 broadband and fixed-line telephony customers from Telefónica UK.

"We believe that the O2 and BE consumer broadband and telephony business is a great fit, with customers used to high-quality products and strong levels of customer service," Jeremy Darroch, Sky's Chief Executive, said in a statement.

The deal to be funded from Sky's existing cash reserves is due for completion by the end of April, subject to regulatory approval. The company expects the transaction to be accretive to earnings per share in the second full year of ownership.

BSkyB is Britain's dominant pay-TV group, providing fixed-line telephony, TV and broadband to 10.7 million households. It has grown its broadband business substantially since its UK start in 2006 and currently has 3.6 million "triple-play" customers, who have opted for the company's television, broadband and telephony services.

"Sky has been the UK's fastest-growing broadband and telephony provider since we entered the market six years ago. From a standing start in 2006, we have added more than 4.2 million broadband customers. The acquisition of Telefónica UK's consumer broadband and fixed-line telephony business will help us accelerate this growth," Darroch added.

Having about 23.5 million mobile customers in the UK, Telefónica will now concentrate on its mobile operations, as the country allocated spectrum for 4G services.

"As we focus on delivering best-in-class mobile connectivity, including next generation (4G) services, we believe this agreement is the best way of helping our customers get the highest quality home broadband experience from a leading organisation in the market," Ronan Dunne, chief executive of Telefónica UK, said.