Other Democrats said Republicans had good reason to preserve that impression. “So far there is bipartisan outrage and concern,” said Margie Omero, a strategist for Democratic candidates for nearly 20 years who has studied midterm voters in swing Senate races this year. “But at this time of year, candidates will try just about anything to find an opening. It could definitely backfire if Republicans look like they’re making political hay out of a threat to the president’s life.”

Republicans rejected the notion that their inquiry had any political implications. “This is not a Republican issue or a Democrat issue,” said Representative Jason Chaffetz of Utah, chairman of a subcommittee looking into the episode. “This is an American issue. I don’t want it to be the political football, but we in the United States of America are self-critical. It’s one of the beauties of our nation is we do hold ourselves accountable.”

And they were aided by the tough statements voiced at Tuesday’s hearing by several of the committee’s Democrats, who told Ms. Pierson that they did not have faith in her leadership and accused her of caring more about protecting her reputation than the president’s life.

While the director of the Secret Service is appointed by the president, the White House under either party typically defers to the agency on how to handle the president’s security. Even when a president is angry at missteps — as reports suggest Mr. Obama was after a 2011 shooting at the White House when one of his daughters was home — he rarely expresses that publicly. For one, it might come across as impolitic. For another, it might offend the very people a president depends on most.

So even though Mr. Obama had nothing to do with the various problems involving his security beyond appointing Ms. Pierson last year, his White House now finds itself in the position of defending the Secret Service to a degree.

At his daily briefing on Tuesday, Josh Earnest, the White House press secretary, was buffeted with sharp questions about when the president found out about the intruder and whether the Secret Service had been candid in describing that incident and others. While acknowledging concerns over the incident, Mr. Earnest gave Ms. Pierson an endorsement at a time when some critics are calling for her resignation.

“What we saw was a willingness that she demonstrated in testifying before Congress under oath on live television today, a commitment to leading an agency with a very difficult mission,” he told reporters. “She is somebody who took responsibility for the incident that occurred about 10 days ago. She also took responsibility for ensuring that the necessary reforms were implemented to ensure it never happens again. That is a sign of leadership.”

And that is a conclusion that Republicans can disagree with, all with Mr. Obama’s interests at heart.