It's every author's dream – to write a book that's so sensationally popular it's impossible to find a copy in the shops, even as it keeps climbing up the bestseller lists.

And so it is for Anthony Shaffer, thanks to the Pentagon's desire to buy up all 10,000 copies of the first printing of his new book, Operation Dark Heart. And then pulp them.

The US defence department is scrambling to dispose of what threatens to be a highly embarrassing expose by the former intelligence officer of secret operations in Afghanistan and Pakistan, and of how the US military top brass missed the opportunity to win the war against the Taliban.

The department of defence is in talks with St Martin's Press to purchase the entire first print run on the grounds of national security.

The publisher is content to sell the books but the two sides are in a grinding dispute over what should appear in a censored version and when it should be released.

Now St Martin's Press says it will put the partly redacted manuscript on sale next week whether or not the defence department likes it – and there doesn't appear much the authorities can do.

The army had cleared the book by Lieutenant Colonel Shaffer, about "black ops" in the Afghan war when he was based at Bagram in 2003, for publication after relatively minor changes.

But when the intelligence services and defence department officials saw it they were alarmed.

They said it contained highly classified material including the names of American intelligence agents and accounts of clandestine operations, and demanded the book be withdrawn on the grounds it "could reasonably be expected to cause serious damage to national security".

The Pentagon is using Shaffer's status as a reserve officer to block him from speaking to the press, but a source close to the publication of the book said that some of the sensitive material had been removed but the defence department was still seeking to purge it of other information that is 20 years old or even in the public domain.

For that reason, there is suspicion that the defence department is less concerned with the nitty gritty of classified material than its broader story of intelligence forays in to Pakistan and his claim that top US military leaders blew an opportunity to win the war years ago.

Shaffer describes in the book how he was part of the "dark side of the force" that operates outside the usual constraints of the military system. He led a group that called themselves the Jedi Knights and specialised in "black ops" including "striking at the core of the Taliban" inside Pakistan. He says that US forces were gaining the upper hand until the military brass involved itself, curbing operations in Pakistan and permitting the Taliban to strengthen again.

Shaffer, who used the pseudonym Christopher Stryker, fell foul of his superiors several years ago after claiming that an intelligence programme he was working with identified Mohammed Atta as a terrorist threat to the US before he led the attacks on 9/11. He was later sacked by the DIA over alleged violations of rules and excessive expense claims.

Joseph Rinaldi of St Martin's Press said that it had offered to sell the first print run to the Pentagon but the details are still being worked out. The Pentagon may yet regret wading in at all. Its plan to pulp the book has provided the kind of publicity that advertising cannot buy and the redacted but still unpalatable version of Operation Dark Heart is charging up the best seller lists even before it is released.