WASHINGTON (Reuters) - (This February 14 story has been refiled to correct description of weapon to semi-automatic rifle, not automatic rifle in last paragraph.)

U.S. Secret Service Director Joseph Clancy testifies before a House Oversight Committee and Senate Homeland Security and Governmental Affairs Committee joint hearing on "Examining Ongoing Challenges at the U.S. Secret Service" on Capitol Hill in Washington November 17, 2015. REUTERS/Kevin Lamarque

U.S. Secret Service Director Joseph Clancy plans to step down next month, the agency said on Tuesday, two years after he took charge of the agency following high-profile security lapses by the service responsible for protecting the president.

“Congratulations Dir Clancy on your retirement! The men & women of the @SecretService are grateful for your 29 years of service & leadership,” the Secret Service said on Twitter.

Clancy will leave on March 4, an agency spokesman said.

Clancy’s departure means that President Donald Trump will be able to select his own security chief. The Secret Service has almost 7,000 employees and is charged with protecting the president and his family as well as combating counterfeiting.

Trump’s predecessor, Barack Obama, named Clancy head of the Secret Service in February 2015 after he had served as acting director for four months.

He took over from Director Julia Pierson, who stepped down after an embarrassing breach in which a man carrying a knife jumped the White House fence and ran into the executive mansion.

Obama picked Clancy despite the recommendation of an independent review panel that the next director be from outside the agency, which it said had become too insular.

Clancy headed the Secret Service as it tackled a heavy workload despite having the lowest number of employees in a decade. He was also in charge during last year’s bitter presidential election without any major security incidents.

The service’s credibility was also damaged in 2012 when it was revealed that members had hired prostitutes while in Colombia in advance of an Obama trip. A man hit the White House with semi-automatic rifle fire in 2011, although the damage was not discovered until four days later.