Rhodri Morgan saw a string of wins for Labour, losing only Wrexham
Labour has had a triumphant night in the Welsh assembly election - but just failed to win an outright majority.
When the final results were declared shortly after 0645 BST on Friday, Labour had taken half of the 60 seats.
But that could just be enough to give Labour a working majority if an opposition AM becomes presiding officer.
However, fears about a low turnout were realised, with only 38% going to the polls, down 8% from four years ago. In one seat it was just 25%.
Gloss taken off
The final total was Labour 30 seats, Plaid Cymru 12, Conservatives 11, Liberal Democrats six, and one independent.
The failure to secure an absolute majority may take a little of the gloss off a night of almost continuous success for Labour.
It was not immediately clear whether Labour would feel able to go it alone or whether - as Rhodri Morgan has previously hinted - he might resume his coalition assembly government with the Lib Dems.
Vote 2003: the final score
Plaid Cymru: 12
Liberal Democrats: 6
Labour won three south Wales "heartland" seats from Plaid: Islwyn, Rhondda and - after a recount - Llanelli, with a majority of just 21.
Labour took a fourth seat from Plaid when Denise Idris-Jones won the crucial north Wales seat of Conwy with a majority of only 72 after two recounts.
But when the final regional list was announced in Mid and West Wales, Labour failed to gain a seat. That meant that Labour won 30 first-past-the-post constituencies and none on the regional list.
Welsh Secretary Peter Hain said: "It is a fantastic result for
Labour. This is a terrible night for the nationalists.
John Marek : blow for his old party
"Their fantasy of an
independent Wales has been buried forever and they are barely neck-and-neck with
"We won three-quarters of the constituency seats which by normal general election standards would be a landslide. This is the best result for Labour in the elections anywhere in Britain."
Plaid had another setback when it lost one of its two regional list seats in South Wales East. The Lib Dems won one seat here, and the Conservatives two - including their first woman AM, 24-year-old Laura Anne Jones.
A Plaid Cymru spokeswoman said the party was disappointed and would reflect on
the result. But she said there was no risk to party leader Ieuan Wyn Jones.
"Obviously our message did not get across as we wanted," she said. "But there is no question about the leadership. His position is totally
Votes were counted through the night
The only independent AM was the former Labour member, John Marek. He delivered his old party its only blow when he won Wrexham against the official Labour candidate.
Dr Marek, who was the assembly's deputy presiding officer, failed to be selected as a Labour candidate, and stood under the banner of his own party.
He won Wrexham with 37% of the vote, against 32% for Lesley Griffiths, his former secretary who was chosen by Labour to stand in his place.
In Wrexham, Dr Marek won 6,539 votes, a majority of just under 1,000 over Ms Griffiths.
Dr Marek's victory could create a dilemma for Labour, which may have to negotiate with him if it fails to win an overall majority.
Dr Marek said: "I think I have been of service to Wrexham people and Wrexham people have shown their confidence in me.
"The decision was should I be rolled over and simply go or should I fight this disgraceful campaign and I decided to do the latter and as it turns out the public have supported me."
Labour stormed to victory in Islwyn with a 19% swing away from Plaid, which had one of the most remarkable wins of the first assembly election in this seat four years ago.
Plaid had other setbacks in potentially promising seats as Labour comfortably held on to Caerphilly and Cynon Valley.
In Islwyn Labour's Irene James won with 11,246 votes, or 55% of the total, up 15%. Brian Hancock, who had held the seat for Plaid, saw his vote fall by 23%.
This huge X was drawn on a Gower beach to remind people to vote
Turnout in the seat was down 7.3%, which appears to have been reflected in many seats in the Welsh Assembly election.
Labour's Leighton Andrews also won Rhondda from for Labour, with a majority of almost 7,000. It was in this seat that Labour suffered probably its greatest shock of the first assembly election.
Labour was also delighted when Alun Pugh won Clwyd West with a 436 majority over the Conservative Brynle Williams.
The Liberal Democrats retained Montgomeryshire, Cardiff Central and Brecon and Radnorshire.
Plaid retained Ceredigion, Meirionnydd Nant Conwy and party leader Ieuan Wyn Jones's Ynys Mon seat.
In Delyn, turnout to 31% from 44% in 1999. And in Alyn and Deeside, where only 32% voted last time, it dropped to 25%.
Mr Hain admitted that the turnout was "dreadful" and said politicians were "talking past people."
Labour won 28 seats in 1999, and tried going it alone for the first 18 months of the administration. But in autumn 2000 it formed a coalition with the Liberal Democrats, the smallest party in the assembly with six seats.