Image copyright Getty Images Image caption Speaker John Boehner reached a final budget deal with White House: he is expected to retire on Friday

Republicans in the US Congress have reached a compromise budget deal with the White House to avert the prospect of a renewed government shutdown.

If passed by both houses, the two-year deal will increase spending by $80bn (£52.1bn).

It will also be the last budget deal reached by President Barack Obama, lasting until March 2017.

The government needs to raise its borrowing limit by 3 November or risk defaulting on its debts.

The Treasury Department had already postponed two bond sales as it waited for an agreement.

The deal is the last to be reached by House Speaker John Boehner before he retires from Congress. He is expected to hand the reins of Speaker to Rep. Paul Ryan on Thursday and retire on Friday.

On Tuesday, Mr Ryan criticised Mr Boehner and President Obama for reaching the terms behind closed doors, saying the "process stinks".

Mr Ryan said he was reserving judgement on the agreement because he had not yet reviewed it. But he added, "this was not the way to do the people's business and under new management we are not going to do it this way".

Debt ceiling

Both Democrats and Republicans had been eager to reach a longer-term deal. President Obama had said he would not sign any more short-term budget agreements, while Republicans in the House of Representatives were concerned that a potential shutdown would harm them in an election.

The agreement addresses two financing issues at once, raising the debt limit and increasing the budget.

The debt ceiling allows the US government to make payments on debt it has already borrowed. Reaching a financing deal prevents automatic budget cuts that were a result of the 2011 budget deal.

Republicans who were keen to defend the military budget were particularly concerned about these automatic cuts.

Committees in the House and Senate still need to produce an omnibus spending bill by 11 December, detailing budgets and spending limits for individual government agencies.

Conservative Republicans who oppose increasing the budget could still stand in the way of the deal. Some may attempt to add provisions known as "riders" to the bill that allow them to push through parts of their agenda, such as defunding Planned Parenthood.