HALIFAX -- Voters in Nova Scotia dumped the NDP on Tuesday after giving Darrell Dexter a historic election victory four years ago, turning this time to Liberal Stephen McNeil, who swept to power on promises to bring soaring electricity rates under control while putting an end to corporate handouts.

It's been 14 years since the Liberals were in government and McNeil returns the party to its glory years of the 1990s with a majority, winning at least 32 seats in the 51-seat legislature.

"I am so humbled and honoured that Nova Scotians have put their trust in me and our Liberal team," McNeil said.

"It is with a deep sense of responsibility and purpose that I will make certain that our plan is delivered and that our commitments are kept."

Dexter lost his seat in Cole Harbour-Portland Valley by 31 votes after a tight battle in the Halifax-area riding, an area he represented in the legislature for 15 years. Several of his top cabinet ministers also went down in defeat as the NDP plummeted to third place with six seats.

"Anyone who gets into politics has to know that it's about losses as well as wins," said Dexter, 56.

"Nova Scotians made a historic choice four years ago when they elected the NDP. I was humbled by the challenges and the opportunities that we faced. We New Democrats had been conscientious critics, but Nova Scotians had never before put us to the test. Nova Scotians, I know that we didn't meet every expectation."

Dexter said he would meet with the party executive to discuss his future.

"Friends, it was a tough campaign. We will have time to reflect on the last 30 days and on the last four years, learning as we go forward."

McNeil, 48, overcame a barrage of attacks ads from the NDP who questioned whether he had what it takes to be premier with the tagline: "Stephen McNeil, Not Worth the Risk."

The former owner of an appliance repair business, who was easily re-elected in his riding of Annapolis, led the Liberals to victory after falling well short in 2009, when the party won 11 seats as the NDP swept the province.

Progressive Conservative Leader Jamie Baillie, who made tax cuts and frozen power rates the central commitments of his campaign, becomes leader of the Opposition with 11 elected members. This was the first election as party leader for Baillie, a 47-year-old chartered accountant who was once chief of staff to former Tory premier John Hamm.

"Tonight shows that when you have the right ideas, when you have the right plan, when you have the people of Nova Scotia in your heart, you cannot keep a good team down," Baillie said after winning his riding of Cumberland South.

Prime Minister Stephen Harper issued a statement congratulating McNeil.

"I look forward to meeting and working with premier-designate McNeil on issues of importance to Nova Scotians and all Canadians, including promoting jobs, growth and long-term prosperity," Harper said.

McNeil ran a safe campaign, offering no great spending initiatives in a platform that promised to chop the number of health districts, cap classroom sizes and reduce spending, except for Health and Education, by one per cent annually. Roughly at the midpoint of the 31-day campaign, McNeil made whistlestop visits to ridings in the Halifax area with Liberal Leader Justin Trudeau, the only federal leader to help his provincial counterpart during the race.

For Dexter, the defeat marked a reversal of fortunes since he became the first NDP premier to govern a province in Atlantic Canada. Instead, Dexter's party had the misfortune of becoming the first government in 131 years to be denied a second term in Nova Scotia.

When Dexter came to power, he inherited a fragile economy and a massive deficit, which he blamed for breaking a key promise when he hiked the harmonized sales tax by two percentage points. The unpopular move was the one of several that tested the electorate's patience, including the NDP's failure to balance the budget as often as they promised four years ago.

His party was also stung by the departures of several key cabinet ministers who decided not to run again, particularly in Halifax, the party's traditional base of support.

Dexter sounded almost apologetic from the outset of the campaign, acknowledging when he called the election that his government had made mistakes, but he chalked them up to the lessons a party learns when it's new to power.

In debates during the campaign, he asked voters to give the party an opportunity to continue the progress it had made on improvements to emergency health care in rural areas of the province, and on jobs and the province's energy future.

The payoff from the NDP's energy and jobs strategy have yet to materialize. A plan to link the province to the Muskrat Falls hydroelectric project in Labrador is still waiting for final regulatory approval and jobs that are expected at the Irving Shipyard to build a new fleet of warships for Canada's navy are still down the road.

The NDP believes a renewable energy future for the province based on Nova Scotia Power's plan to tap into Muskrat Falls will stabilize electricity rates in the long term. The two opposition parties made power rates a central issue in their campaigns, with McNeil promising to break Nova Scotia Power's monopoly in the province by allowing others access to the province's energy grid and Baillie promising a rate freeze.

The Tories and Liberals also promised to stop giving companies government aid to create jobs and were critical of a $260-million forgivable loan to the Irving Shipyard in Halifax to help it prepare for the $25-billion federal shipbuilding program.

When the election was called Sept. 7, the NDP had a healthy majority government with 31 seats in the legislature, while the Liberals had 12 and the Tories seven.