The 54-year-old permanent secretary to the Treasury is to step down at the end of the month, and will receive a life peerage.
Sir Terence, brought into the Treasury by Baroness Thatcher in 1980, will be replaced by Andrew Turnbull, 53, permanent secretary to the Department of the Environment, Transport and the Regions, and a former Treasury official.
Mr Brown, whose officials have continually played down rumours of disagreements with Sir Terence, called the Treasury's top official "one of our country's outstanding post-war economists and public servants".
The Chancellor said: "I know that the Treasury - and chancellors of both parties - have reason to be grateful for the expertise, wisdom and quiet resilience he has brought to the job of Permanent Secretary. I am pleased to count Terry not only as an adviser, but as a friend."
Sir Terence said: "I have decided that now is the right time to consider a fresh challenge and a different mix of responsibilities in the next period of my working life."
Francis Maude, the newly appointed shadow Chancellor, called Sir Terence "the most senior victim to date of Labour's instinct for riding roughshod over the Civil Service".
Mr Maude said: "Time after time, Gordon Brown has ignored Sir Terry's advice. Time after time, the permanent secretary has been excluded from policy discussions by Mr Blair's coterie of advisers. No wonder Sir Terry has decided that enough is enough."
Observers say Sir Terence, a former economics lecturer, failed to shake off his Thatcherite image and was repeatedly squeezed out of key policy discussions by the Chancellor's "inner circle".
"He was always seen as Thatcher's man," remarked one source.
Andrew Turnbull, Sir Terence's replacement, was formerly deputy permanent secretary to the Treasury, and was principal private secretary to both John Major and Lady Thatcher. He was a key member of Norman Lamont's Treasury team in 1992, when sterling was forced out of the European exchange rate mechanism.
More recently, Mr Turnbull interviewed for the position of Cabinet Secretary, the most senior Civil Servant post. The post eventually went to Sir Richard Wilson.
Sir Richard Mottram, the other candidate for the Cabinet Secretary's post and currently permanent secretary at the Ministry of Defence, will replace Mr Turnbull at the Department of Environment.
Outlook, page 25