Scott Moe is the next premier of Saskatchewan.

It took five ballots in the preferential system for the former environment minister to win the Saskatchewan Party leadership.

Moe takes over from Brad Wall, who has consistently ranked as one of the country's most popular and well-known premiers.

Wall enjoyed unbridled economic and political success throughout much of his time as premier, leading his party to three straight majority governments.

But the premier called it quits last August when public anger was lingering over an austerity budget that raised taxes while his government was stinging from scandals.

He pitched his departure as an opportunity for renewal within the Saskatchewan Party, which has been in power since 2007.

Moe will lead a province in a very different fiscal position than the one Wall enjoyed during much of his tenure.

Low resource prices have led to large public deficits despite a recent increase to the provincial sales tax and deep program cuts.

Scott Moe, Saskatchewan, Montreal, environment
Scott Moe walks past reporters at a meeting of Canadian environment ministers in Montreal in October 2016. File photo by The Canadian Press

An investigation into a government land deal is in the hands of out-of-province prosecutors and could lead to charges.

The government is locked in a fight with the federal Liberals over Saskatchewan's refusal to bring in a carbon tax, and is feuding with Alberta over trade issues. The premier-designate didn't waste any time taking aim at Prime Minister Justin Trudeau's government over the federal plans to make polluters pay.

Moe was also responsible for a key provincial department as the government faced questions over revelations uncovered by National Observer, the Toronto Star and Global News in a special investigation, the Price of Oil, into health and safety issues affecting Saskatchewan's oil and gas industry.

The Wall government has declined all requests for interviews about allegations of weak provincial oversight of the oilpatch, but it has provided written statement defending its record.

While Moe won the leadership, it was Wall who gave one of the most animated addresses of the night.

On his way out after 10 years as premier, Wall delivered a final podium-pounding speech, taking aim at the Opposition NDP in his province and the governing New Democrats next door in Alberta.

"It's like their ideology has become an orthodoxy," Wall said. "It's like a church. You can picture it, can't you, this church — thick orange shag rug in the aisle and lava lamps at the altar."

He blasted Alberta's government for running a $10 billion deficit with no immediate plan to pay it back, and he warned the NDP in Saskatchewan would do the same.

"Look next door," Wall said. "They'll add $30 billion to the debt of future Albertans in just three years, with no path to balance ... at least none in the life of the current government."

At the same time, Wall heralded his government's achievements around economic development and population growth, as well as its steadfast resistance to a carbon tax called for by the federal Liberal government.

He also took a shot at the federal NDP and its anti-fossil fuel "Leap Manifesto."

"This thing could not be any more anti-Saskatchewan if it were called the 'We Hate Bunny Hugs, Perogies and Vi-Co Manifesto,'" he said, referring to the uniquely Saskatchewan terms for hoodie and chocolate milk.

The next provincial election in Saskatchewan is set for 2020.

Editor's note: This article was updated at 9:15 p.m. ET on Jan. 27, with additional quotes and background.