Air Canada and Aeroplan have struck a deal for the airline to purchase the loyalty program for $450 million.

The airline will partner with financial services companies Toronto-Dominion Bank, Canadian Imperial Bank of Commerce and Visa Canada to buy Aeroplan from its parent company Aimia Inc.

The two sides have been circling each other for weeks, since Air Canada went public with a hostile takeover offer for Aeroplan at the end of July. That plan valued the program at $250 million. Tuesday's deal sees that price tag almost double.

The deal will see Air Canada pay for Aeroplan in cash, and it'll be on the hook for $1.9 billion worth of unused Aeroplan points. Aimia, meanwhile, will hand over no cash to Air Canada in the deal, nor any other form of debt.

Air Canada set up Aeroplan more than 30 years ago as its in-house loyalty program, designed to reward frequent travellers. But more than a decade ago, Air Canada sold off Aeroplan as an independent company.

Air Canada created Aeroplan 30 years ago, before selling it off and then offering to buy the company back this week. (Daniel Rofusz/CBC)

Now the airline wants to buy back the program, so it can absorb all of its members into a new, as-yet-unnamed loyalty program.

"We are pleased to see that an agreement in principle has been reached as Aeroplan members can continue to earn and redeem with confidence," Air Canada's CEO Calin Rovinescu said.

"This transaction, if completed, should produce the best outcome for all stakeholders, including Aeroplan members, as it would allow for a smooth transition to Air Canada's new loyalty program launching in 2020, safeguarding their miles and providing convenience and value for millions of Canadians."

Shareholders of Aimia still have to vote on and approve the deal, but Aimia's largest shareholder, Mittleman Brothers, LLC, which owns 17.6 per cent of the company, has already come out in favour of it.

"We believe that our acquiescence in agreeing to sell Aeroplan for $450 million in cash was the best available outcome for all Aimia stakeholders," a spokesperson for the Mittlemans said.

Pending that shareholder OK, the deal is expected to progress quickly and be finalized by the fall of this year. But there are still many questions hanging over the deal, most notably what becomes of Aimia after it has lost Air Canada — or what companies besides Air Canada who use Aeroplan will now do.

In recent weeks, Aimia was busily signing deals with other airlines in an attempt to rebuff Air Canada's move.

The program signed deals with Flair Airlines, Porter Airlines and Air Transat to start using the loyalty program in 2020.

It's not immediately clear what happens to those proposed plans now.

CIBC and TD are two major customers of Air Canada, purchasing a combined $650 million a year worth of points in the loyalty program. (Canadian Press)

Air Canada partnering with Visa and two Canadian banks, however, makes perfect sense.

Visa has a vested interest in Aeroplan, since the credit card company offers cards that offer Aeroplan points as a reward for using them. TD has been Visa's main partner on such a card since 2014, after it took over that partnership from CIBC. CIBC, however, still offers cards that lets its customers accrue Aeroplan points.

The two banks are some of Aeroplan's biggest customers, between them buying about $650 million worth of points every year for their cardholders, Industrial Alliance analyst Neil Linsdell estimates. The deals under which both banks buy points from Aeroplan are both set to expire as of 2024.

If the deal goes through, Linsdell assumes that about 1,000 Aeroplan employees would move over to Air Canada, leaving Aimia with a staff of about 650 people. Aimia would be left as a shadow of its former self, but the company does own other assets, including:

48 per cent of Aeromexico's loyalty program, PLM.

A 20 per cent stake in Air Asia's loyalty program, Think Big.

3 million shares in data firm Cardlytics.

5 per cent of Fractal Analytics.

Insights & Loyalty Solutions, which runs loyalty programs on behalf of other companies, including Air Miles Middle East and others.

Adding up all of Aimia's remaining businesses, Linsdell calculates that what would be left of Aimia could be worth as much as $500 million, or about $5 a share, but said, "We will still have to see the details of the definitive agreement however to more precisely value Aimia."

Aimia shares were trading hands at $4.24 a share on Tuesday, up about 20 per cent on the day. Last summer, the company was worth more than twice that, but that was before Air Canada announced it was pulling out of its deal with Aeroplan as of 2020, sending the loyalty programs shares into a tailspin.