As you probably know by now, members of Congress were unable to agree to a short-term funding bill for the government by midnight. As a result, the federal government is shutting down all of its non-essential functions, leaving more than 800,000 employees temporarily out of work.

However, at least one deal was completed at the 11th hour last night. Republic Airways (NASDAQ: RJET) finally agreed to sell its Frontier Airlines subsidiary to Indigo Partners. This deal had been in the works for a long time, but investors had become increasingly frustrated by the numerous missed deadlines in the sale process.

Airline fund Indigo Partners is buying Frontier Airlines

However, Indigo's exclusivity period was scheduled to lapse at midnight on Tuesday morning, which provided an impetus to finish the deal. Frontier Airlines will now go "all-in" as an ultra-low-cost carrier, competing with the likes of Spirit Airlines. Meanwhile, Republic will go back to its bread-and-butter of flying regional jets and turboprops on behalf of legacy carriers.

The agreement
Under the terms of the agreement announced on Tuesday, Indigo Partners will pay $36 million in cash for Frontier and will also assume about $109 million in debt that is attached to Frontier. Indigo will also reimburse Republic for $32 million in pre-delivery deposits it paid for Frontier's new aircraft order with Airbus.

While these are relatively slim pickings, Republic is glad just to be rid of Frontier. In the first half of 2013, Republic's regional operations produced a $48.3 million pre-tax profit, but Frontier lost $6.4 million. While the second half of the year tends to be stronger for Frontier, it's clear that regional flying is the real profit engine for Republic. In the near term, getting rid of Frontier at any price should help Republic stock by removing a major source of earnings volatility.

Moreover, regional flying is still a growth business for Republic, as major airlines appreciate the cost benefits of using the 76-seat regional jets that are the backbone of Republic's fleet. In August, Republic began flying regional routes for AMR's (NASDAQOTH: AAMRQ) American Airlines. By early 2015, Republic will be operating 47 large regional jets for American Airlines. That will represent a significant addition to the 126 jets in that size range that were already in Republic's fleet.

Not quite there
One thing for investors to keep in mind is that the Frontier sale is still not final. The biggest stumbling block in the sale process has been a 2011 agreement that gave pilots an equity stake in Frontier, in exchange for wage concessions. Indigo wanted to cut back the pilots' share of Frontier's ownership.

This issue is still not resolved. According to the sale press release, Indigo has until Oct. 31 to agree to terms with Frontier's pilots and flight attendants. If both sides remain intransigent, there is a very real possibility that the sale will fall through.

Nevertheless, Indigo would not have signed off on the deal unless it thought there was a good chance of coming to terms with the pilots and flight attendants. Furthermore, even if the deal were to fall through, it wouldn't be end of the world for Republic -- the company would still have the option to spin off Frontier to shareholders as a separate entity.

Foolish conclusion
While there is still some uncertainty left in the Frontier sale process, it now seems more likely than not that Republic will complete the sale to Indigo before the end of 2013. The transaction will leave Republic with a regional airline business that produces reliable cash flow and could justify a higher earnings multiple than it currently maintains.

Even with a little uncertainty remaining in the Frontier sale process, Republic looks like a good buy for investors with a two- to three-year time horizon. By the end of that time, Republic will have fully recognized the benefits of its new flying contract with American Airlines, mostly in the form of higher EPS and a higher profit margin.