James Comey’s decision to revive the investigation of Hillary Clinton’s email server and her handling of classified material came after he could no longer resist mounting pressure by mutinous agents in the FBI, including some of his top deputies, according to a source close to the embattled FBI director.

‘The atmosphere at the FBI has been toxic ever since Jim announced last July that he wouldn’t recommend an indictment against Hillary,’ said the source, a close friend who has known Comey for nearly two decades, shares family outings with him, and accompanies him to Catholic mass every week.

‘Some people, including department heads, stopped talking to Jim, and even ignored his greetings when they passed him in the hall,’ said the source. ‘They felt that he betrayed them and brought disgrace on the bureau by letting Hillary off with a slap on the wrist.’

According to the source, Comey fretted over the problem for months and discussed it at great length with his wife, Patrice.

He told his wife that he was depressed by the stack of resignation letters piling up on his desk from disaffected agents. The letters reminded him every day that morale in the FBI had hit rock bottom.

‘He’s been ignoring the resignation letters in the hope that he could find a way of remedying the situation,’ said the source.

‘When new emails that appeared to be related to Hillary’s personal email server turned up in a computer used [her close aide] Huma Abedin and [Abedin’s disgraced husband,] Anthony Weiner, Comey jumped at the excuse to reopen the investigation.

‘The people he trusts the most have been the angriest at him,’ the source continued. ‘And that includes his wife, Pat. She kept urging him to admit that he had been wrong when he refused to press charges against the former secretary of state.

‘He talks about the damage that he’s done to himself and the institution [of the FBI], and how he’s been shunned by the men and women who he admires and work for him. It’s taken a tremendous toll on him.

‘It shattered his ego. He looks like he’s aged 10 years in the past four months.’

But Comey’s decision to reopen the case was more than an effort to heal the wound he inflicted on the FBI.

He was also worried that after the presidential election, Republicans in Congress would mount a probe of how he had granted Hillary political favoritism.

His announcement about the revived investigation, which came just 11 days before the presidential election, was greeted with shock and dismay by Attorney General Loretta Lynch and the prosecutors at the Justice Department.

‘Jim told me that Lynch and Obama are furious with him,’ the source said.

As I revealed in my latest New York Times bestseller Guilty As Sin Obama said that appointing Comey as FBI director was ‘my worst mistake as president.’

‘Lynch and Obama haven’t contacted Jim directly,’ said the source, ‘but they’ve made it crystal clear through third parties that they disapprove of his effort to save face.’