Mark Drakeford is set to become Wales’ next first minister after he won the Welsh Labour leadership election.
The AM for Cardiff West gained 53.9% of the vote, but only after the contest went to a second round.
He will replace Carwyn Jones at the helm of the Welsh Government when he stands down next week.
Vaughan Gething came second with 41.4% of the overall vote after the second round, while Eluned Morgan came third.
Deputy Welsh Labour leader Carolyn Harris revealed the election result at the Cardiff Principality Stadium on Thursday, after a contest that lasted eight months.
Mr Jones announced in April he would step down by the end of 2018 – he has been in the job for nine years.
The Welsh Labour leader elect pledged to make Wales “a beacon of hope in a darkening world and a future which works for the many in our society and not simply for a privileged few”.
He paid tribute to the defeated candidates saying the “richness of ideas” they contributed in the campaign would make Welsh Labour “a stronger party with a greater reservoir of commitment and strength”.
Mr Drakeford said the ultimate aim was to have “a Labour government in Westminster working with a Labour government in Wales”.
“Our most radical and successful days lie ahead of us”, he added.
Before the result Mr Jones told the crowd that it had been the “greatest honour of my life” to be first minister.
He said Welsh Labour “will never stop until we see more justice, more fairness, more opportunity and more equality”.
Around 175,000 people had the right to vote – including around 25,000 party members and others who are part of affiliated trade unions.
Each had two votes. After Eluned Morgan came third, the second preference votes of those who supported her were redistributed.