Labor has won the Adelaide seat of Fisher by just 23 votes, which could result in the Liberals calling for a recount.
After preferences were distributed from last weekend's state by-election, the SA Electoral Commission said on Saturday that Nat Cook won with 10,299 votes compared with 10,276 for Heidi Harris.
The Liberals had been expected to win back the seat, which had been held by former Liberal Bob Such, who became an independent in 2000 and died from a brain tumour in October.
The initial count on Saturday night resulted in a swing of more than nine per cent to Labor, but later in the week Ms Harris was ahead by just 17 votes on a two-party preferred basis.
Senior SA Liberal MP Rob Lucas told AAP the result was disappointing, saying both parties had earlier spoke about asking for a recount if a candidate lost by a small margin.
"We have not made a decision yet, but will be consulting overnight," he said.
"We are not ruling it out."
Labor's win means the Weatherill government will have 24 lower house seats, so will be able to pass legislation without the support of independents Martin Hamilton-Smith and Geoff Brock.
Premier Jay Weatherill has said the result showed a voter dissatisfaction with broken promises from the federal coalition government.
He congratulated Ms Cook on Saturday, saying her life experience and outstanding work will make her a strong and valuable voice for Fisher and South Australia.
"In the end, Labor won Fisher because we ran the best candidate with a positive agenda and I look forward to working with Nat in government," the premier said.
Earlier in the week, senior Liberals admitted Defence Minister David Johnston's claim he would not trust SA-based shipbuilder ASC "to build a canoe" played a large part in the initial swings towards Labor.
Federal SA Labor MP Amanda Rishworth said her colleague's success sent a chilling message to Prime Minister Tony Abbott about abandoning South Australians.
"Instead of washing his hands of another electoral defeat, Tony Abbott must accept his decision to send South Australia's 12-submarine project overseas, $100,000 university degrees, and a GP co-payment have each impacted on today's result," she said.
"Instead of using weasel words to back the Abbott government, (SA opposition leader) Steven Marshall should heed today's result and repudiate Tony Abbott's assault on South Australia."
She said Ms Cook, who founded the Sammy D Foundation after her son was killed in a single-punch attack, ran a strong campaign, talking with locals about issues that mattered to them most including health, education and jobs.