Boris Johnson has been forced to drop his plans to use official Treasury costings of Labour's key policies after an unprecedented intervention by the cabinet secretary.

It comes as shadow chancellor John McDonnell contacted civil service chiefs on Tuesday morning to denounce attempts to use Whitehall resources hours ahead of the official election period as an "abuse of power".

Government ministers had requested calculations to be drawn up on Labour's key spending commitments by civil servants based at the Treasury – provoking outrage for Jeremy Corbyn's top team.

But a Labour source told The Independent the department claimed it will now not publish the analysis, adding: "It's a slap in the face for Tory ministers who blatantly attempted to use the civil service for political ends in an unprecedented way."

As the government prepares to enter what is known as the "purdah" period of the general election campaign, civil servants must not undertake any activity that could call into question their impartiality.

Top 10 marginal seats to watch at the general election Show all 10 1 /10 Top 10 marginal seats to watch at the general election Top 10 marginal seats to watch at the general election North East Fife Currently held by the SNP with a majority of 2 Getty Top 10 marginal seats to watch at the general election Kensington Currently held by Labour with a majority of 20 Getty Top 10 marginal seats to watch at the general election Perth and North Perthshire Currently held by the SNP with a majority of 21 Getty Top 10 marginal seats to watch at the general election Dudley North Currently held by independent, formerly Labour, MP Ian Austin with a majority of 22 LivingInMediocrity Top 10 marginal seats to watch at the general election Newcastle-under-Lyme Currently held by Labour with a majority of 30 Derek Harper Top 10 marginal seats to watch at the general election Southampton Itchen Currently held by the Conservatives with a majority of 31 Rob Candish Top 10 marginal seats to watch at the general election Richmond Park Currently held by the Conservatives with a majority of 45 Robin Webster Top 10 marginal seats to watch at the general election Crewe and Nantwich Currently held by Labour with a majority of 48 Jaggery Top 10 marginal seats to watch at the general election Glasgow South West Currently held by the SNP with a majority of 60 Alec MacKinnon Top 10 marginal seats to watch at the general election Glasgow East Currently held by the SNP with a majority of 75 Christine Johnstone

Speaking to The Independent on Tuesday, Mr McDonnell also described the Conservatives' attempt to use official resources for party political reasons as "scandalous".

"It's an abuse of power," he added. "I've spoken with the civil service this morning. We weren't sure it was happening, but we got confirmation from the permanent secretary."

He continued: "The Treasury civil servant phoned me up this morning to confirm that that was happening today. What he said is they've looked at a range of our policy statements.

"I said first of all, one you do not know what is in the manifesto so that is pure speculation. Secondly, this being done within hours of the formal campaign being undertaken. Thirdly, I think it's an abuse of power.

"I suggested he goes back to the Cabinet Office and advises them it is completely contrary to everything we expect from the civil service in this country. I'm happy for anyone to examine our policies, but to do this hours before a general election campaign is I think an abuse of power. Unacceptable."

The shadow chancellor added that publication of costings of Labour's policies would undermine "people's confidence in the independence of the civil service".

"It's a serious matter," he added. " I don't know any other government in the past that has ever done this literally within hours of a general election campaign.

"I think it's absolutely scandalous, I really do. For me it demonstrates yet again that Boris Johnson thinks no rules apply to him. It's interesting they can this afternoon supply reports from the Treasury costing supposed policies of ours... and yet they are refusing to publish the report from the intelligence committee. That says something about their values in government."