With Mr John Boehner stepping down as Speaker of the House, US lawmakers are likely to avert a government shutdown that could have happened within days because of a row over a spending Bill.
Mr Boehner, who has been Speaker since 2011, told a news conference last Friday: "This morning I woke up, said my prayers, as I always do, and thought: 'This is the day I am going to do this.'"
He will be stepping down at the end of next month and leaving Congress. In recent weeks, Mr Boehner, 65, has been caught in a firestorm, trying to keep the government open, while facing pressure from conservative Republicans refusing to vote for a short-term funding Bill unless it defunded Planned Parenthood - a women's health organisation that carries out abortions.
"Boehner has struggled to fashion legislative strategies that keep his party conference united," said Professor Steven S. Smith, an expert on congressional politics at Washington University in St Louis. "Some House Republicans wanted a more confrontational strategy towards President (Barack) Obama and the Senate and perhaps even more House Republicans were looking for a more vocal, more visible leader."
It came to a point where a faction had threatened to force a vote of no-confidence that would remove Mr Boehner if he did not go along with its demands of cutting funding for Planned Parenthood.
Acknowledging the challenge to his leadership, Mr Boehner told reporters: "My first job as Speaker is to protect the institution... it had become clear to me that this prolonged leadership turmoil would do irreparable harm to the institution."
Mr Obama called Mr Boehner a "good man" and "a patriot". He said: "My hope is there's a recognition on the part of the next Speaker... that we can have significant differences on issues but that doesn't mean you shut down the government."
With his resignation, Mr Boehner no longer has to appease the right-wing conservatives, and can turn to Democratic colleagues for assistance in passing the budget.
Said Dr Irwin Morris, American politics professor from the University of Maryland: "If the Speaker could have brokered a deal within the Republican caucus, I don't think he would be resigning. The Oct 31 resignation opens up cooperation with Democrats on a deal. If no deal were possible - even with Democrats - I think the Speaker would have resigned immediately."
The House is expected to vote this week on a stop-gap spending Bill that will continue to fund the government without linking it to Planned Parenthood. The last time a shutdown occurred in 2013, members of the Republican party had tried to use the budget to take down Obamacare and the party as a whole was largely blamed for segments of the government closing down.
With the resignation, "House Republicans will be under tremendous pressure to avoid the appearance that they cannot govern effectively", said Prof Smith. "I think this will mean even Tea Party Republicans will accept a short-term funding Bill that will avoid a shutdown," he said, adding that the extension may be for only two or three months.
So the buck would be passed to Mr Boehner's successor, whom many experts say could be House Majority Leader Kevin McCarthy from California. Mr McCarthy released a statement last Friday saying Mr Boehner's "depth of character is unmatched", adding that this was the time for Republicans to "focus on healing and unifying to face the challenges ahead". He did not indicate any interest in the Speaker's role.
Even though Mr Boehner was instrumental in pushing through "fast track" authority in June, making it easier for Mr Obama to negotiate international agreements, experts say his departure is unlikely to impact the ratification of major deals such as the Trans-Pacific Partnership.
Trade policy analyst Bill Watson from think-tank Cato Institute said if the next Speaker turns out to be Mr McCarthy, he, too, "has a history of supporting trade agreements".