Labor has won the South Australian election with leader Peter Malinauskas to become the state's 47th premier.
After a big swing away from his Liberal government, Premier Steven Marshall conceded defeat on Saturday night.
It is the first loss for an incumbent government at any state or territory election during the COVID-19 pandemic.
Mr Malinauskas described the win as special and said he would draw confidence and inspiration from the people of SA.
He also thanked Mr Marshall for calling to congratulate him.
"The premier is a class act," he said.
Mr Marshall said it had been an honour and privilege to serve the people of South Australia.
"I think it's great to live in a country where we have free and open elections," he told supporters.
"Today the people of South Australia have spoken. They've elected a new government."
Labor will pick up a string of seats, enough to govern in its own right.
The Electoral Commission had Labor's primary vote on 41 per cent and the Liberals on 34.5 per cent with more than 30 per cent of the vote counted.
That put Labor ahead in 28 seats, the Liberals in 13, and independents in six.
Labor needed 24 in the House of Assembly to claim a majority.
Mr Marshall was also in danger of losing his own eastern suburbs seat of Dunstan.
The outgoing premier gave no indication on Saturday if he would stay on as opposition leader should he retain his own seat.
Across a number of seats, Labor appeared to be attracting voters who supported Nick Xenophon's SA-Best party at the last election.
Labor looked set to win the key marginal contests of King, Newland, Adelaide and Elder; the four seats considered most likely to fall if the opposition was to win.
Labor was also challenging sitting Liberal candidates in a range of seats previously considered safe for the government.
Key independents Dan Cregan in the Adelaide Hills, Geoff Brock, who shifted to the seat of Stuart in the mid-north, and Troy Bell in Mt Gambier were also on track to be re-elected.
Should Mr Brock prevail, Deputy Premier Dan van Holst Pellekaan would also exit the parliament
Australian Associated Press
Sign up for our newsletter to stay up to date.