National Security Agency whistleblower Thomas Drake has agreed to a plea deal that will end his widely criticized prosecution. Drake was charged after leaking information about waste and mismanagement at the National Security Agency, where he worked as a high-level analyst. The material was used for a Baltimore Sun investigative series on the NSA’s overspending and failure to properly maintain its large trove of domestic spy data. He had faced 35 years in prison for espionage even though he wasn’t accused of spying but having classified documents in his basement. On Thursday, Drake agreed to plead guilty to a misdemeanor count of exceeding authorized use of a computer. He had turned down two earlier plea offers. The plea bargain marks a major defeat for the Obama administration, which targeted Drake as part of its crackdown on government whistleblowers.