The Communication Workers Union balloted its members for strikes and was threatening industrial action despite the prospect of a legal challenge by BT.
The company said it had reached an agreement with the union which will be recommended to workers in a ballot.
The union described it as a "fantastic" deal and among the highest settlements anywhere in the UK.
BT said: "Having failed to reach agreement on a one or two-year deal, the two sides have instead agreed on an unprecedented 39-month deal that will take both sides through until March 2013.
"This deal will provide BT with wage stability for several years.
"The agreement will see team members receive pensionable pay rises worth three per cent each financial year from April 2010 to March 2013, with the rise being backdated to January."
BT chief executive Ian Livingston added: "This agreement is good for BT, its employees, shareholders and customers. BT will benefit from a long period of certainty whilst our employees will have financial stability during uncertain economic times.
"I am pleased that we have been able to work with the union's leadership to resolve this matter, as industrial action would have been in no one's interest."
CWU deputy general secretary Andy Kerr said: "Following a very difficult set of negotiations and the first national ballot for strike action in BT since 1987 we're delighted to have resolved this pay dispute through talks.
"This is a fantastic deal for our members providing a fair rise in their basic pay this year and for the following two years.
"This deal is among the highest pay settlements in the country this year recognising the contribution of staff and BT's success over the last year."
The union will ballot members for approval of the deal.