Spirit Airlines will weigh JetBlue’s takeover bid against its planned merger with Frontier.

Spirit Airlines said Thursday that talks with JetBlue Airways would be about a bid to merge the two companies, a deal that threatens to spoil Spirit’s merger plans with Frontier Airlines.

In a statement, Spirit said it had consulted with external financial and legal advisers and stated that JetBlue’s offer could be “prudent” to merge over the cash and shares deal with Frontier that those two companies announced in February. JetBlue’s surprise offer announced this week was above Frontier’s first offering.

“Spirit intends to enter into discussions with JetBlue with respect to JetBlue’s proposal, in accordance with the terms of the company’s merger agreement with Frontier,” the airline said in a statement.

Spirit noted on Thursday that its board of directors did not consider JetBlue’s proposal better than the Frontier merger and said that the board’s prior recommendation that shareholders adopt that merger remains.

JetBlue’s offer on Tuesday, about $ 3.6 billion in cash, initially surprised some analysts who questioned the airline’s assumptions about the ease with which the Spirit could undertake. The value of Frontier’s offering fluctuated with its share price, but was about a third less valuable than the JetBlue bid with Monday’s share prices.

Both JetBlue and Frontier said a merger with Spirit would enable them to better compete with the nation’s four dominant airlines, which control about two-thirds of the domestic market.

The Frontier merger is widely seen by analysts as more straightforward, combining two budget carriers with strong points on opposite shores. The JetBlue deal is not so clear, although some analysts see merit in the airline that Spirit is buying to accelerate growth plans that would otherwise be difficult to execute.