OTTAWA -- In two and a half years, Canadians will gradually start paying more premiums into the Canada Pension Plan.

In several decades, supporters say the "historic" CPP deal reached Monday between Ottawa and most provinces will boost retirement security for future generations.

But by policy-making standards, the agreement-in-principle -- an unlikely outcome just a few months ago -- happened in the blink of an eye.

Even the federal finance minister, a pension expert, had given himself until the end of the year to finish up negotiations.

Instead, the provinces are now being asked to finalize an agreement by July 15 that will eventually increase contributions and retirement benefits through the public plan.

Following weeks of talks and an all-day meeting in Vancouver on Monday, finance ministers emerged with the agreement-in-principle.

Even provinces such as Saskatchewan and British Columbia, which had expressed concerns about the timing of CPP reform, had signed on. Only Manitoba and Quebec declined to agree to the terms.

The agreement came together as pollsters pointed to overwhelming popular support for public pension reform amid concerns about the adequacy of retirement savings.

The federal Liberals ran on platform to upgrade the public pension system, as did their Ontario cousins. The result also means Ontario will abandon its project to go it alone with its own pension plan.

How did this all happen so quickly?

Sources familiar with the talks said doubters had concerns about the potential economic impact of boosting the CPP, even at the late stages of negotiations.

They said Ottawa made a major push in the final days and hours, which helped secure enough country-wide support to expand the CPP. To make the change, they needed consent of a minimum of seven provinces representing at least two-thirds of Canada's population.

The sources also suggested Prime Minister Justin Trudeau himself was involved in the extra effort.

On top of that, Ontario, which had been moving forward its more-ambitious pension plan proposal, backed away from its earlier demands that CPP reform should be just as robust.

Ontario Finance Minister Charles Sousa said in an interview Monday after the announcement that the swift agreement was driven by several factors.

Sousa said all of his counterparts agreed there were "undersaving issues." He also said that Ontario's proposed pension plan -- and its parameters -- gave ministers around the table an example to examine.

And some provinces, especially those hit hard by the commodity-price shock, were looking for only a gradual implementation due to the fragile economy, Sousa added.

The agreement Monday states the CPP premium increases on workers and employees will only start to be phased in on Jan. 1, 2019. Ontario's increase was set to begin in 2018.

British Columbia Finance Minister Michael de Jong said the deal was reached in part because of compromises and the desire to maintain a single, portable CPP across Canada.

"We think this strikes the right balance in that regard," de Jong told reporters after the announcement.

The deal, however, wasn't embraced by everyone.

Federal Finance Minister Bill Morneau said Manitoba needed more time to examine the deal since its government was only a few weeks old.

"This comes very fast and hard for them," Morneau said of Manitoba, whose finance minister wasn't present for the news conference.

Quebec refused to sign the deal out of concern a broad-based premium increase would have a negative impact of low-income earners, the province's finance minister said in an interview.

The province operates its own sister program of the CPP -- the Quebec Pension Plan. Quebec can adjust the QPP as it likes, but it has typically followed the CPP.

Quebec Finance Minister Carlos Leitao said in an interview he will raise QPP premiums according to the CPP deal. He said would also phase them in over the same period.

But unlike the broader-based CPP reform agreement, he said Quebec would only raise premiums on income earned above $27,500.

That's why Quebec didn't sign the agreement-in-principle, Leitao said.

"Those people already have a hard time saving, so their disposable income is pretty tight -- and I think by taking the decision that we took, we will avoid an unfair tax on them and also on their employers," he said.

"As we know, payroll taxes tend to be the most economically inefficient taxes."

To help offset the effect on low-income earners of increased CPP premiums, Ottawa said would it enhance the federal Working Income Tax Benefit and provide a tax deduction.

Critics of CPP expansion have also said it would squeeze workers and employers by imposing additional contributions -- and hurt the economy.

Dan Kelly, the president of the Canadian Federation of Independent Business, warned that the CPP expansion is "pretty devastating" for small businesses.

"The big question I ask myself is what was the size of the federal cheques that were written to some of these provinces to get them to the table?" Kelly said.

Others were thrilled by the announcement.

The head of an organization that has been campaigning for CPP reform for years said Monday's deal would create the first benefits increase for the plan since it was created in 1966.

"It's really historic -- I never thought this moment would come," said Hassan Yussuff, president of the Canadian Labour Congress.