The director of the U.S. Secret Service, Julia Pierson, resigned Wednesday in the wake of heavy criticism over recent security breaches, including a White House fence jumper.

She announced during a meeting with Jeh Johnson, secretary of the Department of Homeland Security, that she would step down. That came a day after she received a savaging from lawmakers over her leadership and perceived failings in the Secret Service.

“Director Pierson offered her resignation today because she believes it is in the best interest of the agency to which she had devoted her career,” Earnest said. He added that the president agreed “new leadership of that agency was required.”

Pierson, a 30-year veteran of the Secret Service, was supposed to have been the person to repair the agency’s reputation after scandals involving drinking and hiring prostitutes during overseas trips.

But her tenure has been rocked by more serious allegations that her agents and officers have not been performing their primary job competently. Under intense questioning on Capitol Hill on Tuesday, Pierson admitted that those charged with securing the White House failed to follow numerous security protocols, allowing a man armed with a knife to penetrate deep inside the mansion.

And late Tuesday, the agency acknowledged that just days before the White House breach, an armed man was allowed to ride in an elevator with the president during an event at the Centers for Disease Control and Prevention in Atlanta.

Mr. Earnest said the White House was not told about the Atlanta incident until Tuesday, shortly before it was reported by news outlets.

Through the last two weeks, Obama’s aides repeatedly declared that he retained full confidence in the agency and in Pierson’s ability to lead it. But the disclosures in the past few days — including revelations that the Secret Service had not been fully forthcoming about the details of the incidents — appear to have been too much.

On Wednesday, Democratic and Republican lawmakers heaped new criticism on Pierson, raising new questions about her ability to lead the agency and protect the president.

Rep. Elijah J. Cummings, D-Md., commended Pierson for stepping down, saying her resignation was in the best interest of the Secret Service and the president. But he said more change was necessary, including, possibly, more resignations.

“I think we need to look beyond her resignation,” Cummings said in an interview. “I don’t want us, after she’s left, to say to ourselves that everything is resolved. Clearly there was a culture there that was not healthy.”

Joseph Clancy, a former special agent in charge of the president’s protective detail who retired in 2011, has been named as the Secret Service’s interim director.

Wire services