(CNN) — JetBlue Airways on Thursday announced it would purchase Spirit Airlines, a combination that would create the nation’s fifth-largest airline,

The announcement comes a day after Spirit pulled the plug on a deal to merge with Frontier.

JetBlue had been pursuing a hostile bid for Spirit even while Spirit sought shareholder approval for a lower-priced deal with Frontier. Spirit had continually expressed concern whether regulators would approve a deal with JetBlue. But shareholders had balked at accepting Frontier’s less-valuable cash-and-stock offer when they had JetBlue’s all-cash offer on the table.

The deal announced Thursday would pay Spirit shareholders $33.50 per share in cash, including a prepayment of $2.50 per share in cash payable upon Spirit stockholders’ approval of the transaction — even before the deal closes.

JetBlue will pay Spirit shareholders an additional 10 cents a month for any delay in closing after December of this year, which could raise the price to $34.15 a share. And if regulators block the deal, JetBlue will pay Spirit $70 million, and its shareholders would get an additional $400 million.

If JetBlue closes the deal this year at $33.50, it’ll be a 38% premium over Spirit’s closing price Wednesday and about $1 billion more than Frontier’s offer had been worth. Shares of Spirit were up 4% in premarket trading on the news, while JetBlue shares were little changed. Frontier shares rose 6%.