Liberal Leader Brian Gallant appears to have won the New Brunswick election amid a vote-counting "fiasco." With vote numbers still to be found and counted, it appears Gallant's Liberals have won a majority government.

Gallant told a small group of supporters who stuck it out until the early morning hours in Grande-Digue that "it is with a great deal of humility that I accept being the premier of our great, beautiful province."

At 12:30 a.m. AT, the Liberals had 42.7 per cent of the popular vote compared with 34.7 per cent for the Tories. The NDP had 13 per cent followed by 6.6 per cent for the Greens and 2.1 per cent for the People's Alliance.

The Liberals and Tories exchanged the lead in seats all night. The Liberals are now elected in 27 ridings, the PCs in 21 ridings and the Green Party in one riding.

The vote-counting process ground to a halt mid-way through Monday night because of problems with the vote tabulation machines. There have been calls by some party leaders for the ballots to be manually counted.

Gallant said he believes in the final vote count despite the problems.

"The count has been delayed, but not denied," Gallant said.

"There is a reason we trust the counting of votes to an independent body, and we have faith in their ability to get it right in the end. We have won a convincing victory in the popular vote and I am pleased that we have won a clear majority of the seats."

Gallant also thanked Progressive Conservative Leader David Alward for his service as premier.

"I look forward to meeting with him in the coming days and I hope that what happened tonight does not stand in the way of a smooth transition," Gallant said.

Tories don't concede

The Tories were not ready to concede the election.

Jason Stephen, the president of the Progressive Conservatives, told supporters that the party wants a full manual count of the ballots before it accepts the results.

"It's fundamental that every voter and every vote be cast in ridings. We're calling on Elections New Brunswick to count every vote by hand," Stephen said.

"Regrettably, it's best to make sure that all votes are counted. At that time we will accept the outcome of the election from the New Brunswick population."

The People's Alliance have also asked for a manual recount.

"I’m sure that a lot of people will be questioning how we do elections in the future, because this is certainly raising a lot of questions about this whole process," party leader Kris Austin said.

Green Party wins seat

Green Party Leader David Coon, who called the handling of the results "a fiasco," won his Fredericton South riding by a narrow margin of about 334 ballots.

Green Party Leader David Coon was elected in the riding of Fredericton South. He is the province's first-ever Green MLA. (Redmond Shannon/CBC) Coon said he has heard from the Liberal and NDP candidates in the riding and he congratulated them on their campaigns.

The Green Party leader said he, too, was still waiting for the final results in his race.

"I am thankful to the voters of Fredericton South. Without the final poll reporting, it is impossible to say for sure, but everything looks good. It looks very good," Coon said.

However, NDP Leader Dominic Cardy was defeated in his Fredericton West–Hanwell riding, behind Tory Brian Macdonald.

Cardy announced in front of his supporters in Fredericton that he will resign as leader of the NDP.

"Ultimately, this is not about one person, and we had the chance in this election, we had a choice," Cardy told his supporters.

"We could either have focused on my single seat or we could have tried to go out there, open our arms wide and say, 'We have a vision for a better New Brunswick, a better government.' And that to me is what this is all about. And someone new will lead that party and they will take us there."

In an interview with CBC News, Cardy took personal responsibility for the party's failure to win a seat.

"I'm taking accountability for that by announcing this evening my resignation," he said.

People's Alliance leader comes close

Austin of the People's Alliance finished in a close second position in his Fredericton-Grand Lake riding, behind Tory Pam Lynch. The preliminary results showed Lynch winning by 26 votes.

Austin told CBC News that he believes he is still in a strong position in his local race.

Several Progressive Conservative cabinet ministers have already been declared defeated, including Transportation Minister Claude Williams, Education Minister Marie-Claude Blais, Agriculture and Fisheries Minister Mike Olscamp and Environment Minister Danny Soucy.

Five races in the province were decided by fewer than 100 votes:

Liberal Gary Keating won Saint John East by eight votes

Tory Pam Lynch won Fredericton-Grand Lake by 26 votes

Liberal Wilfred Roussel won Shippagan-Lameque-Miscou by 44 votes

Liberal Ed Doherty won Saint John Harbour by 71 votes

Liberal Andrew Harvey won Carleton-Victoria by 83 votes

Vote-counting problems

Elections New Brunswick used 713 vote tabulation machines in the election, which had been expected to speed up the process of counting the ballots. This was the first provincial election to use them.

Voters lined up to vote on Monday in the riding of Fredericton–Grand Lake. The Fredericton-area riding had the second-highest number of advance ballots cast in this election. (CBC) However, problems emerged within two hours of polls closing, as manual counts were not matching up with electronic counts. For at least 90 minutes, Elections New Brunswick stopped transmitting updated results.

Michael Quinn, the chief electoral officer, said in a statement Monday night that some of his staff noted some of the results being entered manually were not getting replaced properly with results being uploaded from the tabulators.

"As a result, to ensure the results shared with the public did not provide incorrect information, Elections NB halted updates until we can verify the information," the statement said.

The chief electoral officer, however, defended the system's integrity in his statement.

"We have complete faith that these results are reporting properly," Quinn said of the machine-counted votes.

The vote-counting problems also slowed concession speeches by candidates as they consulted with their lawyers.

Though Progressive Conservative Carl Killen appeared to have lost a tight election in Saint John Harbour to the Liberals' Doherty, he told reporters he has received advice from lawyers not to concede.

“It certainly has been entertaining and interesting. Obviously, you would hope that you could avoid any kind of situation where results become apparently unclear,” Killen said.

“But again we are all at the mercy, in this instance, of a certain technology and all we can do is hope for a rapid resolution.”

Saint John Harbour was the closest race in 2010 when Killen defeated Doherty by seven votes.

This was the first campaign with a new riding map. There were only 49 ridings up for grabs, compared to 55 in previous elections.

When the legislature dissolved prior to the election, the ruling Progressive Conservatives had 41 seats, the Liberals had 13 and there was one Independent.