The military has been asked to provide up to 3,500 extra troops to guard the London Olympics, amid concerns that private security firm G4S will be unable to deliver the number of staff it promised.

Ministers have been forced into the last-ditch move only a fortnight before the Games because they are concerned that G4S cannot guarantee it will be able to supply the 13,700 guards it was contracted to deliver.

One Whitehall insider accused the Home Office of "sticking its head in the sand" over the need to deploy extra military personnel.

"This has been an accident waiting to happen. The Home Office has waited to make a decision on this because G4S has been saying it is all in hand. But we've run out of time."

The home secretary, Theresa May, has been pressing G4S to provide assurances over its commitments, but patience in Whitehall ran out last weekend and talks began over whether the Ministry of Defence could fill the gap.

"The army will provide an insurance policy," said a Whitehall source. The armed forces are already providing up to 13,500 personnel for the Games – split between the venues and back-up for police. Under the contingency plans, this could reach 16,500 – 7,000 more than are being deployed in Afghanistan.

The MoD has been seeking guarantees that any soldiers drafted in at the last moment will be properly compensated for cancelled leave.

A defence source said that the army units that may be required had been identified and put at a state of shortened readiness. They will be deployed incrementally, as needed, and logistical and training hubs were already being set up to co-ordinate them.

"This is not about the security of the Olympics being in peril," said the source. "Nobody would let that happen. The military has been asked to help, so of course the military will help. I think the general public will be relieved to see members of the British armed forces at the venues providing security. Quite a lot needs to be done, this is a big issue for us, but we can do it."

The issue of venue security has been the most contentious for organisers and the government in the runup to the Olympics, after the London organising committee (Locog) admitted in December it had wildly underestimated the number of staff required to deliver security at 34 Olympic venues in London and around the country.

The figure required more than doubled from 10,000 to 23,700 and the budget went up from £282m to £553m. All security costs for the Games are met from the £9.3bn government funding package provided from public funds, as opposed to Locog's £2bn operating budget.

The Home Office permanent secretary, Dame Helen Ghosh, has admitted that Locog's original "best estimate" of 10,000 security staff within venues had been a "finger in the air" exercise.

Another source on the London 2012 board has previously described the security operation as a "blind spot" in Locog's planning for the Games.

It will spark fresh questions over the extent to which the Games will appear overly reliant on the armed forces – last week it was confirmed that surface-to-air missiles would be located at six sites around the capital, despite protests from residents and some MPs.

The navy's biggest warship, HMS Ocean, will be stationed in the Thames and four Typhoon fighter jets will be on standby at RAF Northolt in Middlesex. Armed Puma helicopters will also be on standby.

The London 2012 chairman, Lord Coe, has insisted that London will not feel like a "siege city" during the Games and Chris Allison, the Metropolitan police assistant commissioner and national Olympic security co-ordinator, has insisted it will be a "blue Games".

Organisers have insisted that 8.8 million ticketholders will be reassured rather than panicked by the sight of military personnel, citing the example of Wimbledon. But such large numbers of military personnel have never been mobilised in the UK during peacetime.

Organisers believe G4S needs at least 19,000 security guards to fulfil its £284m contract, which requires 10,400 licenced guards and 3,300 students. The extra guards are needed as a buffer when staff fail to turn up or fail security screening. G4S were also due to manage the 7,500 military personnel and 2,500 volunteers. The 3,500 extra troops may not all be required but the government is keen to have them in place in case G4S is unable to deliver.

The government is believed to have agreed to a "just in time" approach to training the guards in a bid to avoid costs spiralling further. In addition to £553m security budget, a further £600m has been set aside for the police operation, although the Home Office has said it should be able to deliver for £475m.

G4S said it had 4,000 staff in venues and more than 20,000 in training. A spokesman for G4S said that issues over "scheduling and deployment" were being dealt with.

"Our programme to train and deploy our security workforce for the 2012 Games is continuing and has stepped up in the past few weeks," said the spokesman. "Issues we have faced over scheduling and deployment are being worked out and we are continuing to work hard to get a robust workforce in place for the start of the Games."