The image of a spy as a macho and hyper-sexual 'lady killer' in the James Bond mould looks like history, with MI5 now ranked as one of the most gay-friendly places to work in Britain.

Gay rights group Stonewall has put Her Majesty's Secret Service in its top 10 of most desirable employers for members of the LGBT community.

Being noted for its diversity credentials suggests that being a spy is very different from the testosterone-fuelled orgy of violence and girls, epitomised with bravura by Sean Connery and others on the silver screen.

The league table ranks Military Intelligence Section 5 – to give its full name – at number seven. In contrast there is no sign of its sister nest of spies, MI6.

Public and charity bodies and teaching institutions comprise the majority of the top 100 – with a smattering of banks and construction firms.

The Army has been ranked inside the top 50, at number 46, which is eight places higher than the Royal Navy. The Air Force just scrapes in to the 100 best employers – at 96.

Stonewall's ranking has James Bond rubbing shoulders with officials at the Crown Office, health bureaucrats in Nottingham and workers at a homelessness charity.

The chart was compiled by totting up how well organisations did on the Workplace Equality Index. The full list can be found here.

"These organisations – and all those who work with us through our Diversity Champions programme – are helping to change attitudes, support LGB staff and create a better place for all of their staff to work," said Ruth Hunt, chief executive of Stonewall.