It is entirely possible that Jim Prentice could be the next prime minister of Canada. Stephen Harper would be very happy with that. Those who think Mr. Harper would not welcome Mr. Prentice as his successor don't know this Prime Minister's mind.

When Mr. Harper was forming his first cabinet, back in 2006, Derek Burney, the head of his transition team, asked him who would be deputy prime minister. No one, Mr. Harper told Mr. Burney, a former Mulroney chief of staff and U.S. ambassador. I don't want a second in command.

You have to choose someone for the bureaucracy to talk to when you're away, Mr. Burney insisted. Mr. Harper chose Mr. Prentice, whom he had appointed as chair of Operations, one of two key cabinet committees, along with Priority and Planning.

Story continues below advertisement

By 2007, Mr. Harper was ready to offer Mr. Prentice the Finance portfolio. He only changed his mind when Jim Flaherty threatened to quit cabinet altogether if he was moved.

Mr. Prentice got Industry instead. And as the years passed, the Ops committee became more powerful and influential than P and P, because when it comes to priorities and planning, Mr. Harper is a committee of one.

But Mr. Prentice is an ambitious man and to the left of Mr. Harper on social policy, though Mr. Harper was actually more sanguine about Mr. Prentice's aspirations than his advisers, who were bothered by them.

In any case, when it became clear that Mr. Harper was settling in for a long haul as Prime Minister, Mr. Prentice resigned as environment minister for a job at the Canadian Imperial Bank of Commerce.

Now he is Premier of Alberta and Mr. Harper is facing his last election. The next few months could decide the fate of both men.

Mr. Prentice will need to convince Albertans that he has a credible long-term strategy to align government revenues with spending requirements, and to wean Alberta off its boom-and-bust dependence on oil. He'll also need to win an election, more or less as an afterthought.

If Stephen Harper loses the Oct. 19 general election, he will resign immediately. If he is able to form a minority government, he will govern for up to a year before stepping down. If he should win a second majority, he will probably depart in early 2018, once the sesquicentennial celebrations have concluded.

Story continues below advertisement

Canada's 22nd Prime Minister has fulfilled most of his agenda: making the federal government permanently smaller, calming federal-provincial relations, stiffening the spine of the Criminal Code, diversifying trade.

The last big item is to bequeath a united and electorally viable Conservative Party to his successor. That could prove a challenge.

R.B. Bennett, John Diefenbaker and Brian Mulroney all left the prime ministership with the conservative party of the day in a shambles. The old conservative coalition of Quebec nationalists, Prairie populists and Ontario Red Tories was always unstable, and any occasional encounters with government invariably did party unity more harm than good.

Mr. Harper has crafted a more enduring coalition of suburban Ontario and Western voters. But the party could still splinter into populist and Red Tory factions after he leaves. The Conservative Leader's most important remaining priority is to prevent that. Although he will remain publicly neutral, Mr. Harper will work hard behind the scenes on his succession.

Defence Minister Jason Kenney is a possible pick, but those who know what they're talking about predict that he will ultimately prefer to play kingmaker rather than be king.

Transport Minister Lisa Raitt is a contender, but her connections to the party membership are shallow. Industry Minister James Moore is a possibility, and Saskatchewan Premier Brad Wall would be a very strong candidate, if his French were better.

Story continues below advertisement

Mr. Prentice speaks French about as well as Mr. Harper did when he became Conservative Leader in 2004. He's Ontario by birth, Alberta by adoption. Although he's socially more liberal than Mr. Harper, there is nothing substantial in the Harper legacy that he would reverse.

Most important, if Mr. Prentice could weld his Tory base to the old Reform base by ending Alberta's years of drift and deficits, then he could be a powerful unifying figure within the party, and an attractive candidate nationally.

The timing isn't great. Even if Mr. Harper does make it to 2018, that would be early for Mr. Prentice to step down as Premier. But Albertans might forgive him if it meant the continued vitality of the Conservative Party nationally.

Of course, if Mr. Harper is retired by the voters this fall, then the window for Mr. Prentice will close. Whether it opens again down the road no one can predict.

But as Jim Prentice seeks to set things right in Alberta, Stephen Harper will wish him well. For both their sakes.

John Ibbitson is writer-at-large in The Globe's Ottawa bureau. His biography of Stephen Harper will be published by Signal/McClelland & Stewart in September.