A UK equality charity has named Britain's domestic spy agency its employer of the year.

Stonewall, a UK charity devoted to lesbian, gay, bisexual and transgender equality gave MI5 top marks Tuesday among 400 employers. The results are based in part on a confidential survey of 60,000 staff members, who are asked about workplace culture, diversity and inclusion.

The annual survey underscores the strides made by the spy agency, which failed in the past to welcome gay candidates. Critics had argued that disclosing sexual preferences would leave spies more vulnerable to blackmail.

But after the 2005 London transit attacks that killed 52 commuters, Britain's spy agencies — both MI5 and MI6 — have led aggressive recruiting drives for candidates from diverse ethnic and sexual backgrounds.