Patrick Kennedy, the State Department's outgoing undersecretary for management, had a disastrous final four years in the post, as he was blamed for the failure to protect American lives in Benghazi, Libya, and was caught protecting Hillary Clinton during the investigation into her unauthorized use of a private email server.

Kennedy, who was forced to resign by the Donald Trump administration on Thursday, has held the undersecretary post for the past nine years—and his tenure has not gone smoothly.

His most public connection to controversy came during an investigation into the 2012 terrorist attack that killed four Americans in Benghazi. Investigators faulted Kennedy for deciding to reduce the number of security personnel present in Libya prior to the attack.

Due to his role in Libya operations, Kennedy was called to testify before the House Foreign Affairs Committee in 2013 and then again before the House Benghazi Committee early last year.

Republicans such as CIA Director Mike Pompeo charged that Kennedy was hiding information during his testimony to protect the State Department.

"When the Benghazi committee interviewed him, he was a deft witness—he knew what to say and what not to say," said Pompeo, who was at the time a member of the House of Representatives. "Kennedy is the quintessential bureaucrat."

Kennedy's attempts to shield his bosses at the State Department were uncovered again during the investigation into Hillary Clinton's use of a private email server last year.

Kennedy was responsible for the State Department's records and information technology during the four years Hillary Clinton used the server, and would have been responsible for approving Clinton's unauthorized email arrangement.

It was revealed last year that he worked to help Clinton emerge unscathed from the scandal. An FBI official said Kennedy repeatedly "pressured" the bureau to declassify a sensitive email about the Benghazi attack that Clinton sent using her unsecure email server.

During the presidential campaign, Trump pointed to Kennedy's actions as evidence of "collusion between the FBI, Department of Justice, and the State Department to try and make Hillary Clinton look like an innocent person when she's guilty of very high crimes."

Pompeo agreed that Kennedy was "protecting" Clinton.

"It is clear that Kennedy was protecting himself and his boss, Secretary Clinton, from any responsibility for the massive security failures related to Benghazi or for anything to do with Secretary Clinton's homebrew server," Pompeo told Foreign Policy.

Despite his many failures, some former State Department officials are treating Kennedy's ouster as a "big loss."

"These retirements are a big loss," David Wade, Secretary of State John Kerry's chief of staff, told the Washington Post in reference to Kennedy and other resignations. "They leave a void. These are very difficult people to replace."