Premier Gladys Berejiklian has been returned to power in NSW, but she will need to wait for the final count before knowing if she can form a majority government.
The coalition needs just one more seat to be reach the 47 needed to allow it to govern in its own right in the 93-seat parliament following Saturday's election.
Labor could only win two of the 13 extra seats it needed to return to government after two terms in opposition, and has no hope of forming a minority government.
With most of the votes counted on Saturday night, the coalition had 45 seats - 34 for the Liberals and 12 for the Nationals.
Labor held 35. They are expected to pick up Coogee and possibly East Hills in Sydney.
The Greens retained their three seats, while the Shooters, Fishers and Farmers Party is now likely to have three MPs, retaining Orange and picking up Barwon and probably Murray from the Nationals.
The three independents - Alex Greenwich, Greg Piper and Joe McGirr - were all returned.
ABC election analyst Antony Green said the Berejiklian government suffered a swing of 2.3 against it, but it wasn't been enough to force it out of power.
The Liberal-Nationals went into Saturday's election with 52 seats in the lower house but it needed to only lose six seats to relinquish its majority.
Three Nationals seats - Dubbo, Barwon and Lismore - were still in doubt on Saturday night.
Candidate Dugald Saunders was in a tight fight with independent Mathew Dickerson to retain the seat of Dubbo being vacated by former leader Troy Grant.
Nationals leader John Barilaro said he had expected some swing to the Shooters.
"When people feel anxious in the regions, they'll look at their vote going elsewhere. The Shooters have been out there as an alternate voice," he told the ABC.
The state's most marginal seat - East Hills in Sydney - was also going right to the wire with the Liberals' Wendy Lindsay just ahead.
More than four million people had been expected to cast their votes on Saturday, at more than 2200 polling booths around the state.
Nearly 1.1 million people took advantage of early voting, with about one-in-five making their decision at pre-poll centres or via the post, internet or telephone.
Meanwhile, in the Upper House, former federal Labor leader Mark Latham looks like making a return to parliamentary life as a One Nation MP.
A total of 21 NSW Legislative Council seats were up for election on Saturday.
Counting will continue on Sunday.
Australian Associated Press