Tony Blair warned Gordon Brown a week ago that his campaign to become the first president of the European Council was doomed after a decisive intervention by the German chancellor Angela Merkel, according to senior Whitehall sources.

To the dismay of key ministers, who wanted Brown to push for Britain to take an economic portfolio in the European commission once Blair's hopes were dashed, Brown insisted on maintaining his candidacy until moments before Thursday's European summit.

The prime minister hailed the summit as a victory after Britain secured one of the two jobs created under the Lisbon treaty – the high representative for foreign policy taken by Britain's current European commissioner, Lady Ashton.

The summit concluded quickly on Thursday, but only after weeks of horse trading across the EU and a bitter row in London. Blair told Brown that his chances were over after a second – and decisive – phone call with Merkel late last week. Merkel told Blair she bore him no ill will but that the job would have to go to a leader from the dominant centre right.

"Tony informed Gordon at the end of last week ... that he saw no realistic chance of getting agreement around his candidacy," a Whitehall source said.

Poul Nyrup Rasmussen, who heads the EU grouping of Labour and social democratic parties, told the Guardian that Europe's two big political tribes, the Christian and social democrats, agreed months ago to split the jobs between them. He said Brown had known for some time that Blair had no chance.

"There was an expectation that at a certain time there should come a change from Downing Street... We all knew it couldn't be otherwise," added Rasmussen.

Senior ministers told Brown that Britain's interests would be best served by securing a major economic portfolio in the European commission. Brown, who agrees that new legislation on financial services could pose a threat to the City of London, did draw up contingency plans for an economic job: retain trade, or aim for the internal market or competition policy portfolios.

No 10 had not lost hope that Shriti Vadera, an ex-minister now working for the G20, or the FSA chief Adair Turner might be persuaded to take one of these posts.

But a second group of ministers advised Brown that an economic job would have played badly in the media after Britain had made such a great play for the presidency. Brown therefore kept Blair's name in the frame in hope of increasing UK leverage to secure the high representative post.

"There were two groups in government," a key figure said. "There was the real world argument – the best interests of the UK are served by securing a strong economic portfolio to protect the City. Then there were the media managers."

Brown believes it is wrong to play down the significance of the high representative post, not least as Ashton will have enhanced status in the commission.

William Hague, the shadow foreign secretary, said Ashton's appointment may have been part of a deal that would give a major economic job to France. "If Gordon Brown has done a deal that would mean a French commissioner being in charge of the economic issues that affect Britain the most, then that could be a serious concern," he said.

The Guardian today reveals that Ashton was spied on by MI5 in the late 1970s. Shami Chakrabarti, the director of Liberty and a friend of Ashton, said: "Cathy was vice-chair of CND. She was subject to intrusive surveillance by MI5."