Media playback is unsupported on your device Media caption Julia Pierson had faced angry questions in Congress after several security breaches

The head of the US Secret Service, tasked with guarding US President Barack Obama, has resigned following several high-profile security lapses.

Julia Pierson offered her resignation to the Secretary of the Department of Homeland Security on Wednesday.

A day earlier, she faced angry questions in Congress about a major breach of White House security.

News of another incident involving an armed man allowed in a lift with Mr Obama compounded calls for her to go.

"Today Julia Pierson, the Director of the United States Secret Service, offered her resignation, and I accepted it," Secretary of Homeland Security Jeh Johnson wrote in a statement.

"I salute her 30 years of distinguished service to the Secret Service and the Nation."

Analysis - Jon Sopel, BBC North America editor

In the immediate aftermath of the security breach, the former head of the Secret Service, Julia Pierson, praised the officers on duty that night at the White House for their extraordinary restraint.

"Restraint?" some commentators and lawmakers have exclaimed in disbelief.

In the era of the suicide bomber is restraint really what you want when an intruder armed with a knife has penetrated into the inner sanctum of the leader of the free world?

Secret Service asleep at the wheel

Image copyright European Photopress Agency Image caption New fencing was installed around the White House following a security breach on 19 September

Mr Obama also expressed his appreciation to Ms Pierson for her long history of public service, White House spokesman Josh Earnest told reporters on Wednesday.

Ms Pierson offered her resignation because "she believed it was in the best interests of the agency to which she has dedicated her career", Mr Earnest added.

In an interview with Bloomberg News after her resignation was announced, Ms Pierson said she knew Congress had "lost confidence in my ability to run the agency''.

Joseph Clancy, in charge of the presidential protective division of the agency, will take over as acting interim director.

High-ranking members of the US Congress had been calling for Ms Pierson's resignation in the wake of her testimony before a House oversight committee on Tuesday.

Litany of lapses

Nov 2009: A couple filming a reality show make it past Secret Service checkpoints into a dinner for visiting Indian prime minister

Nov 2011: A man parks a car directly south of the White House and shoots at the residence at least seven times. Secret Service supervisors fail to realise it has been struck for four days - until a housekeeper discovers the damage.

April 2012: Eleven Secret Service employees preparing for the president's visit to Cartagena, Colombia, bring sex workers back to their hotel.

Nov 2013: A senior supervisor starts a row after demanding access to a woman's room at a hotel overlooking the White House.

March 2014: Three agents are sent home from the Netherlands after one is found passed out drunk in a hallway.

16 Sept 2014: An armed security contractor with a criminal record is allowed to board a lift with the president.

19 Sept 2014: A man scales a fence at the White House and enters through an unlocked and unalarmed door.

There she acknowledged the Secret Service security plan was "not executed properly" during a recent breach of the White House.

On 19 September, suspect Omar Gonzalez, 42, allegedly scaled a fence and gained entry to the famed US residence while carrying a knife.

On Wednesday, Mr Gonzalez pleaded not guilty to charges against him, including entering a restricted building or grounds while carrying a deadly or dangerous weapon.

Prosecutors say he jumped the main fence around the White House and gained entry inside through an unlocked door, then barrelled past a guard and ran into the East Room before being tackled.

Image copyright AP Image caption Omar Gonzalez with wife Samantha, in an undated photo

Mr Obama and his family were not at the White House when the intrusion happened, having departed about 10 minutes earlier by helicopter.

The incident is the latest in a string of security lapses overseen by the Secret Service, tasked with guarding the Obama family.

On 16 September, Mr Obama is said to have been in an Atlanta lift with an armed security contractor who had assault convictions.

This contravened a protocol that only members of the Secret Service are allowed to carry weapons in the presence of the president.