Labour has fallen just short of an outright majority in the Welsh assembly after the final results came in from north Wales.
Labour has won 30 seats, but was unable to the 31st needed for an overall majority but is set to try to form a government.
The Conservatives took Aberconwy and Clwyd West, key Labour targets.
Tories lost their leader Nick Bourne, but did well otherwise. However, Plaid and the Lib Dems had a poor night.
Lib Dems finished behind the BNP in a number of seats.
Labour was tantalisingly short of the numbers it needed by Friday morning, with 13 seats still left to declare in north Wales when counting started at 0900 BST.
First Minister Carwyn Jones said: "The people of Wales have shown that what they want to see is a Labour-led government.
"If people were unhappy with the Welsh Labour Party then we wouldn't have done as well as we have.
"We've got five exciting years in government ahead of us."
Asked by BBC Wales political editor Betsan Powys about the problems in the education system that had already been identified, Mr Jones said Labour knew there were "some parts of the education system that need improvement".
He also told Jamie Owen on the BBC Wales results programme: "You are right to say that once the day is over the real work begins. I know full well that from next week we've got a lot of work to do."
Mr Jones said the impact of the UK coalition had a big impact on the election. "We did find people on the doorstep time and time again saying they were unhappy with what's happening at a UK level."
Conservative Janet Finch-Saunders took Aberconwy from Plaid Cymru, also dashing Labour's hopes in the seat
Clwyd West was another target seat Labour was looking to win, but Tory Darren Millar comfortably held it.
'Very strong position'
The first result to declare in north Wales was Ann Jones, holding the Vale of Clwyd seat for Labour.
Plaid Cymru's Ieuan Wyn Jones and Alun Ffred Jones held their seats of Ynys Mon and Arfon. But after a disappointing night for his party, Ieuan Wyn Jones declined to answer any leadership questions.
Elsewhere, Labour retained Alyn and Deeside, Wrexham, Clwyd South and Delyn.
Although Plaid's Rural Affairs Minister Elin Jones held Ceredigion, deputy leader Helen Mary Jones lost her seat in Llanelli - which she had held since 1999.
Ron Davies, former Labour Welsh Secretary who was in Tony Blair's first cabinet, failed to make a comeback as Plaid's candidate in Caerphilly.
In mid Wales, Tory Russell George took Montgomeryshire from the Lib Dems.
The seat was won in 2007 by then Lib Dem candidate Mick Bates, who was expelled by the party after being convicted for drunkenly attacking a paramedic.
But Welsh Lib Dem leader Kirsty Williams, who held Brecon and Radnorshire, said: "It's been a tough campaign for the Welsh Liberal Democrats. We've seen some disappointing results tonight."
Despite a generally good performance, Welsh Tories will have to find a new leader after Nick Bourne lost his regional seat.
Welsh Secretary Cheryl Gillan paid tribute the role he played in "transforming the image and fortunes of the Welsh Conservative Party".
"This result is a great loss to the National Assembly and to me personally."
As well as assembly seats, people have also voted on whether to replace the first-past-the-post system for electing Westminster MPs with the alternative vote (AV). Counting will start in the AV referendum at 1600 BST on Friday.
There are indications that turnout may be lower than some had expected - around 41% - but final figures will not be known until later on Friday.