WASHINGTON, April 22 (Reuters) - The Trump administration is nearing a deal to rescue low-cost carrier Spirit Airlines that could include up to $500 million in government-backed financing to help it keep operating through bankruptcy, three people familiar with the matter told Reuters.

The package would likely be a loan to keep Spirit running during bankruptcy, which would later become a longer-term loan when the airline exits bankruptcy, with warrants giving the U.S. government a potential stake of up to 90%, the sources said.

The discussions underscore one of the unintended consequences of the Iran war launched by Washington: a surge in jet fuel prices that has roughly doubled costs, squeezing margins and pushing weaker airlines closer to the brink.

For Spirit, which was already struggling to turn a profit before the fuel shock, the spike has intensified doubts about whether it can survive on its own.

President Donald Trump told CNBC on Tuesday that he would prefer to see Spirit acquired, but said government involvement was possible, signaling a willingness to intervene.