WASHINGTON – The US Congress settled on a deal to reopen the federal government and avoid default on America’s debt just hours before the Treasury Department would have lost its authority to borrow money.Senate Majority Leader Harry Reid and Minority Leader Mitch McConnell forged an agreement whereby the US government will be funded until January 15, and its borrowing limit will be extended through February 7.At press time, the deal was awaiting approval in both the Senate and the House of Representatives, but leaders from both parties implied it would go through. It was expected to pass late at night, clearing the way for it to arrive on President Barack Obama’s desk to sign before the deadline on Thursday.Fitch Ratings, one of the three main global credit ratings agencies, warned Congress this week that its paralysis might lead Fitch to lower it evaluation of America’s creditworthiness.But markets, evidently numb to the politics of Washington, barely slipped through the crisis and rallied on Wednesday upon word that a deal had been reached.Congress has never come so close to breaching the debt ceiling ($16.7 trillion before the deal) as it has over the past 16 days, since Congress first failed to pass a resolution that would fund operations of the federal government.A failure to reach a deal would have meant the US risked defaulting on its payments for the first time.NASA has virtually shut its doors over the past two weeks, as has the Nuclear Regulatory Commission and the National Institutes of Health. The government shutdown led to over 800,000 furloughs.Republicans in the House of Representatives refused to entertain a bill that would reopen the government without fundamental changes to the Affordable Care Act, or “Obamacare,” Obama’s signature legislation.Leading that fight was Sen. Ted Cruz of Texas. On Wednesday, he criticized the agreement that would avoid default, while declining the opportunity to delay its passage with a filibuster.The deal “provides no relief for Americans from Obamacare,” Cruz said.Indeed, it makes only cosmetic changes to the health law, requiring income verification for those registering for insurance.The measure has bipartisan support.Seventy-four percent of Americans disapprove of how the Republican Party handled the crisis, according to an ABC/Washington Post poll released on Monday. Fifty-three percent disapprove of how Obama handled the crisis.House of Representatives Speaker John Boehner faced an important political test as the crisis came to an end. The speaker was challenged to break the Hastert Rule, the principle that no speaker should bring to a vote a bill that does not have majority support within his party’s caucus.But for months, Boehner said he would not let the US default on its obligations. He repeated that commitment throughout the government shutdown, nearly every day, until the day before the debt deadline.