The director of the Secret Service, who was given the assignment of shoring up that agency in a period of crisis, is leaving one of Washington’s toughest jobs after a little more than two years.

In late 2014, President Barack Obama summoned Joseph P. Clancy, his former detail leader, back from the private sector amid a string of security breaches and employee misconduct in the agency. On Tuesday, Clancy said it’s time to retire for good. He leaves March 4, giving President Trump the chance to select a new director.

Clancy steered the Secret Service as it strained under a heavy workload and the lowest number of employees in a decade. At one point, the 6,300-person agency had 500 fewer people on staff than it was authorized to hire.

On Clancy’s watch, the Secret Service successfully tackled an intense and rancorous 2016 presidential election campaign — one that featured fisticuffs at some raucous rallies — without major incident.

Clancy said his proudest moments came in the summer and fall of 2015 when he watched his team simultaneously shield Pope Francis on a historic four-city visit to the United States and 170 foreign dignitaries at the U.N. General Assembly in New York. The agency also relied on staffers from other arms of the Department of Homeland Security.

“We had been going through a tough time, but I could see in their eyes and hear in their voices they were determined to succeed,” Clancy told The Washington Post. “I knew they were exhausted, but they were determined, and knowing what they had been through over recent years, it was inspirational to me.”

But Clancy also leaves behind a workforce that continues to complain of burnout, low morale and a lack of experienced, visionary managers.

Former director Ralph Basham said Clancy will be remembered as a reassuring presence “who has done right by the service.”

“Due to his calm and professional manner and approach to problem-solving, he's just done a tremendous job for the department,” Basham said. “Not to say they don’t have issues remaining, but I think he's put the organization on a good path to getting better.”

A few names are being discussed to replace Clancy: George Mulligan, the current chief operating officer; Mickey Nelson, a former assistant director; and new Deputy Director William Callahan.

Clancy joined the Secret Service in 1984, rising to become the leader of Obama's detail in 2009 and retiring in 2011. He returned to his native Philadelphia, taking a job as a security director for Comcast.

Clancy agreed to be the interim director in an October 2014 in telephone call with the president, the same day Obama accepted the resignation of Director Julia Pierson.

On Pierson's watch, a series of embarrassing incidents unfolded in quick succession. Officers and agents were caught in drunken misbehavior while preparing for presidential visits in the Florida Keys and the Netherlands, and even across the square from the White House at a hotel bar. The final straw came Sept. 19, 2014, when a limping, mentally ill veteran jumped the White House fence, bypassed more than a dozen Secret Service guards and hurtled deep inside the White House mansion.

In early 2015, an expert panel studied the agency's dysfunction and urged the president to pick an outsider as the permanent director. Congressional Republicans agreed. But Obama chose Clancy; he and his wife preferred the comfort of the familiar “Father Joe.”

On Tuesday, House Oversight and Government Reform Committee Chairman Jason Chaffetz (R-Utah) said Clancy's departure provides that critical opportunity to put an outsider atop the service.

“A fresh set of eyes and new perspective is needed to restore the prestige and status expected of such an elite agency,” he said in a statement.

The Obama administration knew that Clancy wouldn’t rock the boat but hoped he would instill calm in a divided agency.

In that, he largely succeeded.

A few cases of head-scratching misconduct plagued his time at the top, though. In March 2015, the No. 2 over Obama’s detail and a senior supervisor returned to the White House in a government car after a night of heavy drinking. They drove through an active bomb threat investigation, and supervisors never alerted Clancy to the incident.

In the most recent case, former and current agents are openly furious with Clancy for not taking action against a high-level supervisor who publicly said she doubted she could “take a bullet” for Trump.

Both the Obama administration and congressional Republicans hoped Clancy could shore up the Secret Service by boosting morale and rapidly hiring enough agents and officers to keep up with a flood of departures and early retirements.

On that score, he struggled.

In the 2016 employee survey, the service ranked dead last among all federal agencies for employee satisfaction, 305 out of 305.

Clancy sought to speed up a cumbersome hiring process. In 2015, 416 people retired or resigned from the agency, but only 78 new employees came aboard, according to a federal workforce report. The agency said it picked up the pace last year, hiring 700.

Clancy said he faced a steep learning curve, having never worked in the headquarters before. He described needing to gain the trust of the workforce and also to study up.

“I had to acknowledge our past but try to convince our workforce that our body of work over 150 years was too great to simply ignore,” he said. “I had to get up to speed quickly on the work of each of the directorates. What were their goals and their needs? How could I help them? I had a lot to learn.”

He has now given a collective 29 years to the Secret Service.

The 61-year-old grandfather said he always planned to be an interim director and is looking forward to moving out of his bachelor's condo in Washington. He'll move back full time with his wife in their home in the Philadelphia suburbs, where they both grew up, met and started a family.

Christian Marrone, the chief of staff to the Homeland Security secretary, praised Clancy for his personal sacrifice in returning to the agency.

“Without hesitation, Joe Clancy stepped forward to serve his country and help the service when it needed it most,” Marrone said. “In my strong view, Joe is a hero and a role model to all of us that aspire to serve.”