WASHINGTON — Eric Shinseki resigned as secretary of the Department of Veterans Affairs on Friday, leaving behind a sprawling bureaucracy embroiled in scandal and burdened with a decades-old legacy of overwhelmed facilities and management failures that his successor must now confront.

President Obama announced Mr. Shinseki’s departure after a 45-minute Oval Office meeting between the two men that ended a week of mounting demands from both parties for the secretary to step down. Mr. Obama, who appeared pained at the turn of events, hailed Mr. Shinseki as having an unquestioned commitment to the nation’s veterans, but he said the political storm had made Mr. Shinseki’s continuing leadership untenable.

“We don’t have time for distractions,” Mr. Obama said. “We need to fix the problem.”

Fixing the problem at the department now becomes an urgent political matter for the president, once again raising questions about whether the candidate who pledged in 2008 and 2012 to make government work efficiently has lost grasp of the government he now leads.