It is certainly not how they used to treat criminals at the Tower of London where grisly executions have made the 940-year old fortress a symbol of ruthless British justice.

It emerged on Monday that instead of a night in the dungeon or a trip through Traitors' Gate, guards at the royal palace mistakenly released a night intruder they found prowling in the grounds and missed the fact that he had stolen a set of keys to drawbridges and other locks at the supposedly closely-guarded home of the Queen's crown jewels.

In the early hours of last Tuesday morning, as the embers of bonfire night died away, the intruder scaled the fence on the western perimeter and dropped down into a pedestrianised area close to the main gate.

The man's presence was detected by the guards in the security control centre and the night guard was despatched to apprehend the trespasser and was on the scene within three minutes. By then, though, the intruder had managed to swipe a set of keys from an unguarded sentry box just outside the main gates, as a search would no doubt have revealed.

The Tower authorities sheepishly admitted that instead of getting to the bottom of what he was doing there in the small hours of the night and what might have been in his pockets, the guard simply led him from the premises and let him go.

The embarrassing result is that the thief remains on the loose, the keys are nowhere to be found and the red-faced managers of the royal palace are contemplating a bill of several thousand pounds for changing the locks.

It was the kind of sloppy security that could make the ravens restless and should give the Beefeaters a bad name. But it appeared that the Tower's famous red and black-clad guard yeoman warders were not to blame. The perimeter area where the incident happened was not patrolled by the former noncommissioned officers from the armed forces whose job it is to guard the Queen's jewels and to give tours, but by a private security firm, ICTS, to which the contract to defend the perimeter of the palace was outsourced in 2010. "It was the third-party security firm that was the first port of call on the outside," said the Royal Palaces spokeswoman.

When it secured the contract, Paul Jacomb, the ICTS general security director, said: "The Tower of London's management rightly demands the highest of standards. We believe that the ICTS approach to delivering integrated solutions, combining effective manpower, specialist canine services and cutting-edge technology was clearly a key differentiator in the selection process."

Kelly McCartney, commercial director of ICTS, said the firm was "not making any comment" on the break-in.

A spokeswoman for Historic Royal Palaces, which is the custodian of the Tower of London, said: "During this incident, keys for a restaurant and conference rooms were taken together with a key to an internal lock to the Tower drawbridges that is not accessible from the outside.

"It would not have been possible to gain access to the Tower with any of these keys and at no point was the security of the Tower at risk. All affected locks were immediately changed.

"We have carried out an internal investigation and have concluded that our well-established security systems and procedures are robust. However, on this occasion, these procedures were not carried out to the expected standard. A staff disciplinary procedure is under way to address this issue."

The Metropolitan police said: "An allegation of theft has been made to police, which is being investigated by Tower Hamlets CID."

It is not the first time that an intruder at the Tower has been bizarrely let off. In 1671, Irish colonel Thomas Blood pretended to be a parson to trick his way into the room where the crown, orb and sceptre were kept and knocked the guard unconscious before trying to make off with the treasures, apparently crushing the crown into bag and stuffing the orb down his breeches. He was arrested at the scene after trying to shoot another guard, but was pardoned by King Charles following a trial.

One of the main attractions for visitors is the nightly "ceremony of the keys", the locking up of the Tower of London which has taken place every night for at least 700 years. The stolen keys were a different bunch to those used in the ceremony, but the irony is not lost. The Tower's publicity material for the ritual states: "The importance of securing this fortress for the night is still very relevant because, although the monarch no longer resides at this royal palace, the crown jewels and many other valuables still do!"