Israel's former prime minister, Ehud Olmert, has accused the current prime minister, Binyamin Netanyahu, of wasting almost $3bn preparing for a war on Iran that never took place, underlining how seriously Netanyahu considered launching an attack in the last two years.

The public criticism of Netanyahu, who is expected to be re-elected later this month, follows some scathing criticism of the prime minister by the former head of Israel's domestic intelligence agency Shin Bet, Yuval Diskin. Diskin accused Netanyahu of spending the money on "harebrained adventures that haven't, and won't, come to fruition". The charge was levelled by Olmert as Netanyahu once again pledged that Iran would be top of his agenda if he was re-elected.

Speaking in a television interview on Israel's Channel 2, Olmert said: "In the last two years, 11bn shekels [$2.9bn] were spent on operations which were not and will not be carried out. These figures go well beyond the multi-year budgets. We were told that 2012 was the decisive year. They managed to scare the entire world, but nothing was done in the end."

Olmert also appeared to back the claims by Diskin that Netanyahu and the defence minister, Ehud Barak, discussed launching an attack on Iran over alcohol and cigars.

"Did I hear about it? Yes. Should Diskin have talked about it? I'm glad he didn't reveal operative details, but when it comes to issues like this, it was his duty to speak up," said Olmert.

"If a man like Diskin, who has behaved responsibly during all his years of public service, reaches the conclusion that the Israeli public must know what's going on when their fates are being decided on, it is vital that he does so."