The armed forces will take two years to recover from their involvement in the Olympic Games because so many personnel have been deployed at short notice and taken away from normal duties, the military's chief planner for the Games has said.

In an interview with the Guardian, Wing Commander Peter Daulby also warned that critics who wanted a smaller military put the country at risk of not being able to cope with these kind of civil emergencies, or a "national strategic shock".

Daulby, who was put in charge of the military's Olympic planning 18 months ago, said the need to send thousands of extra troops to the Games at the last minute after the G4S debacle showed "the country needs a military for more than war fighting".

Describing the Olympics as the largest peacetime operation ever performed by the armed forces, he said: "It just shows you the dangers of pulling the military down. I am sure that there are some people who think that if we are a smaller military power we will be less likely to get involved in international operations.

"If we shrink the military, do we really understand what we are losing? Look at the speed with which we pushed up the throttle. It proves the military offers the country a huge amount of resilience."

Daulby, 45, was one of several senior officers who spoke to the Guardian about the military's contribution to the Olympics, which increased more than threefold from May last year.

Then, only 5,000 personnel were expected to be deployed, but that increased to 18,000 when the Olympic organisers Locog admitted they had significantly underestimated the number of security guards needed at the venues – and G4S conceded it had over-estimated its ability to recruit and train the extra staff.

"We were originally planning to provide niche capabilities," said Daulby. "When the requirement for venue security was doubled, that was a bit of a game changer. We had to generate 18,000 people. That does not mean that there are 18,000 spare people. It means that the government has prioritised [the Olympics].

"It will take two years to recover from this, to get back to normal, to get everything back into kilter. You can't expect them to go back to normal routine very easily."

He said the UK's commitment to Afghanistan had not been affected by the Olympics, but the military had exceeded by 6,000 the maximum number of people he thought the Ministry of Defence could supply.

"Anything above 18,000 and you start to shut down elements of defence," he said.

"We put a bucket of men up and that was taken. We put another bucket of men up and that was taken. We have proved we can do it … most people think they have done something really special here. I think there is a great sense that the UK has nailed this."

The rush to train and get everyone ready meant "we were building the plane at the same time as flying the plane", he said.

"We did not think that it would be healthy for the Olympic Games to be too militarised. Our fears were not well founded. It has been an enhancing experience."

Brigadier Richard Smith said the scale and difficulty of the military's role in London 2012 was comparable to operations in Iraq and Afghanistan.

"In terms of threat it is not comparable, but in terms of scale it is more than comparable. The complexity of the basing and the training to get them to task … it's been a massive operation in a short space of time.

"In Iraq and in Helmand, we could build up over time and establish ourselves. For this we had a short space of time and we had to get it right first time."

Smith said the armed forces had realised the need to reconnect with the British people after years of operations abroad, and admitted there was anxiety how the public would react to so many people in uniform at a sporting event.

With the UK withdrawing from Afghanistan, and British bases in Germany being closed, too, the public will need to get used to seeing more of the military, he said. "It is a really important point. We recognised we have an opportunity to set conditions for us when we are predominantly UK-based armed forces. We want to easily connect with the people from whom we are drawn. This has given us the opportunity to show us as professional and approachable human beings."

Smith said the military had tried to be flexible when presented with concerns, including those from some competitors. "In the equestrian community, they were worried that the helicopters from HMS Ocean would scare the competitors in the dressage at Greenwich Park. We adjusted the flight paths so they did not. We didn't want to blunder in as a blunt tool."

Asked if the military could mount a similar operation in five years' time – when defence cuts will have stripped 20,000 posts from the army – he said: "I am not going to answer that. Give us a challenge and we will rise to it."

Among the most difficult tasks in the days before the Games was finding enough portable toilets and showers to equip Tobacco Dock, east London, where 2,500 personnel were stationed for the Games. The military works on the basis of one toilet for 10 people, and one shower for every 20.

"It has been a mammoth task," said Major Austin Lillywhite. "We had to go to Ireland for the portable toilets. We couldn't find them anywhere else at such short notice."

The MoD hired 192 coaches to ferry troops to and from the Olympic venues, and spent £300,000 on equipment such as TVs for entertainment at the temporary bases.

It also signed a laundry contract so that military uniform for everyone on duty had been cleaned and ironed.

"We want the men and women to look a good standard. If they all turned their irons on at the same time in the morning, the power would go down."

None of these contracts are coming out of the military budget. The Treasury and G4S will be paying for the military's extra contributions.

G4S announced on Sunday that it was giving £2.5m to the armed forces as a goodwill gesture. The donation will go towards welfare amenities, including sports equipment, and to sports associations which have backed serving athletes, including rowing gold medallists Heather Stanning and Pete Reed.

Provisions supplied to feed the Olympics troops

Eggs: 205,800

Vanilla ice cream: 21,056 litres

Potatoes: 38,999 kilograms

Sausages: 7,756 kilograms

Apples: 33,376

Beef: 7,252 kilograms

Chicken: 5,240 kilograms