Gladys Berejiklian has made history as the first female New South Wales Premier to win an election in her own right.
The 48-year-old daughter of Armenian migrants won a third consecutive term for the Coalition, a feat which hadn't been achieved in the state since 1971.
Labor struggled in Sydney, where it picked up just one seat from the Liberal Party, after video emerged of Opposition Leader Michael Daley blaming Asian immigrants for taking jobs away from young Australians.
The election also saw former federal Labor leader Mark Latham win an upper house seat for One Nation, as the Shooters Fishers and Farmers Party tripled their presence in the lower house.
Scroll down video
Gladys Berejiklian has made history as the first female New South Wales Premier to win an election in her own right and hailed it as a victory for minority Australians with a long surname
Mr Latham, running under the banner of Pauline Hanson's party, has returned to politics for the first time in 14 years, after winning an eight-year term in the NSW Legislative Council.
He secured 6.1 per cent of the upper house vote, with preference flows, which was well above the upper house quote of 4.55 per cent.
'At the moment we are tracking towards two quotas and when the metropolitan numbers are counted in the Legislative Council they are pretty encouraging,' he said.
Labor has only gained Coogee in Sydney, with the Opposition's poor result blamed on video of Mr Daley blaming Chinese immigrants with a PhD for taking the jobs of young Australians.
He vowed to continue as Labor leader, even though the Opposition failed to win the Liberal Party's most marginal seat of East Hills.
The daughter of Armenian migrants is Australia's first female conservative premier to win an election in her own right, after 5.27 million voters cast their ballot (pictured are Krikorat and Arsha Berejiklian, the proud parents of the Premier)
In her victory speech, Ms Berejiklian said she was proud to live in a state where 'someone with a long surname and a woman' could be Premier.
She promised to work closely with the state's three independents 'whether or not my government is a majority or a minority government'.
'We will continue to govern for all of you,' she said, in the presence of past and present Liberal prime ministers John Howard and Scott Morrison.
'For the first time in nearly half a century the people of NSW have seen as fit to give us a third term,' Ms Berejiklian said.
Ms Berejiklian (sisters Rita and Mary pictured) is also the state's first premier to win an election, eight years after Labor's Kristina Keneally lost in a devastating landslide
The Premier declared her Liberal Party had not conceded a seat at the election, despite being on course to lose Coogee in Sydney's south-east to Labor as it kept its most marginal electorate of East Hills, in the city's south-west.
'The Liberal Party will not concede a single seat loss in this election,' she said.
'In some of our seats we've had a swing to the government.'
COOGEE
Labor appears to have gained this electorate in Sydney's south-east from the Liberal Party. The ALP lost this seat in the 2011 landslide loss after holding it for 37 years.
LISMORE
Labor could gain this northern NSW electorate from the Nationals, which it hasn't held since 1965.
BARWON: The Shooters Fishers and Farmers appear to have taken this seat from the Nationals, which had held it since 1950 when they were the Country Party.
MURRAY
The Shooters have also gained this electorate in the far-west of NSW which has mainly been in conservative hands since 1932.
Ms Berejiklian is also the state's first female premier to win an election, eight years after Labor's Kristina Keneally lost in a devastating landslide.
With fixed, four-year terms, her win means the Liberal and National parties will, by 2023, have been in power for 12 years, the longest in the history of the Coalition parties in NSW.
Other results show Labor is ahead in the Nationals-held seat of Lismore, which it hasn't held since 1965.
The government's net loss of four seats, so far, would see the Coalition stay in power with a narrow majority, holding 48 lower house seats in the 93-seat Legislative Assembly.
Mr Daley conceded defeat shortly after 9.30pm AEDT, making a phone call to the Premier as results showed the Opposition with only 35 or 36 seats.
He told party faithful 25 minutes later he intended to remain leader of the Labor Party and said his 134 days heading the Opposition, since November, wasn't enough time.
'I thought that would be enough time to get across the state,' he said.
'It really hasn't been a great result for the major parties and we do have more work to do.'
Mr Daley mistakenly said he had been the member for Maroubra since 1995 even though he didn't win that Sydney seat in a by-election until 2005, when former Labor premier Bob Carr retired from Parliament.
'I thank the people of Maroubra who have re-elected me again tonight,' he said.
'They've been doing so continually since 1995.'
Ms Berejiklian's victory marks the first time since 1971 the Coalition has secured a third consecutive term in NSW (she is pictured with former Liberal Prime Minister John Howard and current PM Scott Morrison)
Opposition Leader Michael Daley conceded defeat shortly after 9.30pm AEDT making a phone call to the Premier.
During the final week of the campaign, Mr Daley had told a Sky News People's Forum debate Labor would spend another $3 billion on TAFE, when the Opposition policy was to increase spending by $64 million over four years.
The man who wanted to be the next premier of NSW had his sums wrong by a staggering 47 times.
ABC election analyst Antony Green declared a victory for the government shortly after 8pm AEDT.
'This has been a very good result for the Liberal Party tonight,' he said.
'There will be a Coalition government.'
He told party faithful 25 minutes later he intended to remain leader of the Labor Party and said his 134 days heading the Opposition, since November, wasn't enough time
Labor is struggling to make up sufficient ground in the New South Wales election to have a chance of forming a minority government (party true believers pictured on election night)
With a narrow majority, Ms Berejiklian won't need to court regional independents Greg Piper and Joe McGirr, or Sydney MP Alex Greenwich, to form a minority government.
In the upper house she may need to rely on the support of former federal Labor leader Mark Latham, who is likely to have won a seat for One Nation.
Labor is unlikely to have significantly improved on its 2015 seat tally of 34 as it struggled in Sydney.
The swing towards the Labor Party was too weak in Sydney for it to gain enough seats to have a shot at forming a minority government with the support of the Greens.
Statewide, the Liberal Party had 33.2 per cent of the primary vote with the Nationals winning 8.6 per cent, giving the government 41.8 per cent of first preferences.
Labor had 33 per cent first-preference support.
The daughter of Armenian migrants would be Australia's first female conservative premier to win an election in her own right
In Sydney, Labor only picked up Coogee from the Liberal Party, where it secured a 3.6 per cent swing.
The is an area where the $2.1 billion South East Light Rail has been delayed by a year to May 2020, as the cost blew out by $500 million.
Updated counting showed a 0.3 per cent swing to the Liberals in East Hills, the party's most marginal seat.
EAST HILLS
The Liberal Party's most marginal seat in south-west Sydney was won by less than 400 votes in 2015.
Barrister Cameron Murphy, a former head of the NSW Council for Civil Liberties and son of a High Court judge, is running again.
He faced a nasty smear campaign in 2015, with pamphlets falsely accusing him of being a 'paedophile lover' based on his work as a civil libertarian.
The margin is 0.4 per cent.
COOGEE
The Liberal Party could struggle to held this beach-side seat in Sydney's south-east.
Bruce Notley-Smith, the state's first openly gay lower house MP, has a bare 2.9 per cent margin.
The delayed completion of the South East Light Rail could hurt the chances of the former Randwick mayor.
GOULBURN
Labor has a strong chance in this seat near Canberra, even though it hasn't held it since 1965.
The margin of 6.6 per cent is also relatively safe for the Liberal Party.
Cabinet minster Pru Goward, however, is retiring and Labor's candidate Ursula Stephens was previously a senator.
LISMORE
While Labor hasn't held