Britain's police forces are expected to have to make deep cuts in officer numbers after a Treasury decision to protect Home Office spending on counter-terrorism above all else, the Guardian has learned.

Theresa May, the home secretary, is believed to be very close to a final settlement on her budget that protects counter-terrorism funding from immediate cuts, though not from the effects of inflation over the next four years.

Police forces have been drawing up cost reduction plans in anticipation of next week's comprehensive spending review announcement. So far the chief constables of West Midlands, Lancashire, Hampshire, Kent and North Wales have indicated to their authorities that they plan to cut a total of 6,467 police jobs over the next four years.

The decision to protect counter-terrorism funding follows reports in July that Scotland Yard's counter-terrorism chief, John Yates, had told a private gathering of chief constables that "eyewatering" cuts of £150m to the budget to fight terrorism could imperil national security.

It is expected that the decision to exempt counter-terrorism from the cuts of up to 25% demanded by the Treasury will mean deeper cuts in other parts of the £10.2bn Home Office annual budget.

May has dismissed Police Federation claims that up to 40,000 police jobs are at risk as "pure speculation". She has also said that back office, bureaucracy and procurement costs rather than frontline policing should be the first source for savings.

But a CSR submission leaked by the Association of Chief Police Officers to the Home Office says the scale of the 25% indicative savings envisaged can only be delivered by "a significant reduction in headcount of police forces".

The document says "undue emphasis" has been placed on uncontroversial areas such as procurement, which account for only 10% of police budgets. "Even an optimistic 10% saving [in procurement] could not realise more than an overall 1% budget reduction," it argues.

The chief constables have also told the home secretary that the "new economic reality" will make a number of forces unviable – "some sooner than others" – and the issue of police mergers will be back on the table. Acpo suggests that guidelines for the move from 43 police forces in England and Wales to a "smaller number of strategically sized forces" is needed.

Most forces have already imposed recruitment freezes. Police officers are currently protected from the risk of redundancy by statute. Legal advice obtained by several chief constables, however, has cleared the way for them to compulsorily retire officers after 30 years' service. Regulations say officers can be "required to retire" after 30 years if their continued employment would not be in the interests of efficiency. Already 250 officers in North Wales have been told they may be "retired in this way" and the Police Federation fears it could open the floodgates to thousands of officers – often among the most skilled and working in specialist units – leaving the police service.

Paul McKeever, chairman of the federation, yesterday renewed his plea to ministers not to "throw the bobby out with the bathwater".

Graham Maxwell of Acpo said it was a fallacy to claim that the required savings could be realised without any impact on frontline services. "The sums simply do not add up," he said. Acpo has warned that there is a doubt over the future of specialist units such as those covering domestic violence, rape, hate crime and child protection.

Danny Alexander, chief secretary to the Treasury, said: "Senior people in the police service should know better than to make irresponsible statements like that on the basis of information that hasn't been settled yet, in terms of how much money they are going to get."