The blockbuster move, aimed at slashing costs, boosting investment and offering expanded "quad-play" services, was praised by analysts and sent BT's share price soaring to the top of the London stock market.
"BT has agreed definitive terms to acquire EE for £12.5 billion. The combination of EE and BT will provide customers with innovative, seamless services that combine the power of fibre broadband with wi-fi and advanced mobile capabilities," it said in a statement.
The cash-and-shares deal, which remains subject to regulatory and shareholder approvals, will be financed by a £1.0-billion shares sale.
Following completion, Deutsche Telekom will hold a 12 percent stake in BT and will be allowed to appoint one member of the BT board. Orange will meanwhile hold a 4.0 percent stake in the company.
BT Group had already announced in December that it was in discussions to purchase EE.
"This is a major milestone for BT as it will allow us to accelerate our mobility plans and increase our investment in them," BT chief executive Gavin Patterson said in the statement.
"The UK's leading 4G network will now dovetail with the UK's biggest fibre network, helping to create the leading converged communications provider in the UK.
"Consumers and businesses will benefit from new products and services as well as from increased investment and innovation."
Patterson added that there would also be "significant operating and capital investment efficiencies" arising from the deal.
In reaction, BT Group's share price surged 4.96 percent to 444 pence in Thursday afternoon deals on London's FTSE 100 index, which was 0.14 percent lower at 6,850.21 points.
The announcement comes amid fast-moving sector consolidation, with BT keen to return to the mobile phone market after a 12-year absence.
BT, formerly known as British Telecom, is also eager to match other rivals in Britain such as Virgin Media that offer 'quad play' bundles comprising fixed and mobile phone services along with broadband Internet and pay-television.
The move also follows BT's 2013 entry into television, which has seen it go head-to-head with rival pay-TV broadcaster Sky over the screening of live English Premier League football.
Back in 2002, BT demerged its domestic mobile phone division O2, before selling it to Spanish giant Telefonica in 2005 for £17.7 billion.
In a fresh twist last month, Telefonica revealed it was in talks to sell O2 to Hong Kong's Hutchison Whampoa, operator of the Three mobile network in Britain, for £9.25 billion.
"Today's announcement that BT has agreed definitive terms with EE... signals that, barring a shareholder revolt, this deal will almost certainly happen," said Imran Choudhary, consumer insight director at Kantar Worldpanel ComTech.
"For consumers, in the short term post-merger they could expect to see some competitively priced deals as the new entity looks to retain consumers across mobile and home markets and to grab as much market share as possible, especially with Three/O2 hot on its heels.
"Consumers can also expect to see a greater variety of deals, as quad play and content-based propositions arrive to the market," he added.