On the last night before election day, NDP Leader Rachel Notley made a final plea to voters.

鈥淥ur economy is more diversified,鈥 she said. 鈥淎lberta is a climate leader. We are closer than ever to building a pipeline to tidewater.鈥

鈥淲e have built or modernized more than 240 schools ... expanded access to post-secondary education ... improved public health care ... our lowest paid workers make a better living.鈥

It wasn鈥檛 enough to save her job. The United Conservative Party won a majority government and former federal cabinet minister Jason Kenney is now Alberta鈥檚 premier-designate.

Notley retained her seat for the NDP in the Edmonton-Strathcona riding, beating UCP candidate Kulshan Gill.

In a gracious concession speech, Notley thanked her supporters and reminded them of the work Alberta's NDP government has accomplished in the last four years.

"This may feel like a step back but remember we have made tremendous progress,鈥 said Notley.

鈥淔our years ago Albertans hired us to do a very difficult job鈥 and we did that job with purpose and we did that job with integrity,鈥 she added. 鈥淭oday Alberta is a better place because of it.鈥

Notley said she spoke with Kenney before her speech and offered her congratulations. She wished his UCP government well, adding that democracy is our greatest power.

She vowed that as the leader of the Opposition, she will do the job to best of her ability and will continue to fight for the values of the NDP Party.

鈥淵es tonight鈥檚 vote is not the result we had hoped or worked so hard for,鈥 said Notley. 鈥淏ut no matter what our role is in legislature, we will not rest.鈥

Notley came to power in 2015 just after global oil prices tanked, causing a crisis for a government used to getting more than a fifth of its revenue from natural resources.

With lower prices, it was clear that there would be major job losses -- unless the province could build a new pipeline to an ocean, allowing producers to fetch more money per barrel overseas.

All the big pipeline proposals were in doubt. Environmentalists in B.C., the U.S. and Quebec all vowed to block any pipes from crossing their territories, in the name of fighting climate change.

In a province where the Progressive Conservatives had won every election since 1971, the 2015 election was widely expected to be a battle between the PCs and the breakaway Wildrose Party.

But Notley stunned pollsters by taking the lead. She seemed to connect with a wide range of voters, much like her father Grant Notley, who was leader of the Alberta NDP from 1968 to 1984.

Voters also liked her pitch. Rather than making cuts to health care and education to make up for the fast-declining oil sector royalties, she proposed raising corporate taxes and taking on more debt.

She also argued she could get the 鈥渟ocial licence鈥 to build a pipeline by showing Alberta was serious about fighting climate change. That meant a carbon tax and a cap on total oil sands emissions.

On May 5, 2015, Notley鈥檚 NDP grew from a four-seat rump to a 54-seat majority in the 89-seat legislature.

鈥淐hange has finally come to Alberta,鈥 she said that night. 鈥淣ew people, new ideas, and a fresh start for our great province.鈥

鈥淚 think we have elected the most women of any government caucus in Canada,鈥 she added. 鈥淪o that鈥檚 kind of cool.鈥

As premier, Notley raised the minimum wage to $15 an hour, instituted a child benefit, and added new protections for workers -- a nod to her career as a lawyer for public sector unions.

She also won praise for seeing the province through one of its biggest crises: the 2016 forest fires that burned down parts of Fort McMurray and forced 88,000 to flee.

Two years into her mandate, it looked like Notley would finally get a pipeline. Prime Minister Justin Trudeau approved an expansion of the Trans Mountain pipeline through B.C.

鈥淟et me say this definitively, we could not have approved this project without the leadership of Premier Notley and Alberta's climate leadership plan,鈥 he said at the time.

But the pipeline got stalled by a federal court, and Notley鈥檚 partnership with Trudeau鈥檚 Liberals failed to deliver. Albertans blamed them both for the province鈥檚 economic malaise.

The Alberta unemployment rate was stuck at 7.0 per cent in March, far above the national rate of 5.7 per cent. Calgary鈥檚 was 7.7 per cent 鈥 the second highest in the country after St. John鈥檚.

Meanwhile, the province鈥檚 debt ballooned to more than $50 billion.

Economic anger translated into a desire for change.

But while the voters turned on the NDP, they weren鈥檛 too hard on Notley. All major polls found her statistically tied with or ahead of Kenney on measures of likeability, even though they said they would not vote NDP.

In other words, don鈥檛 count her out of politics just yet.

----

Can't see our live blog below? Here's a link.

--