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 is expected to 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.
The Carmarthen-born academic, 64, has pledged to extend the smoking ban to town and city centres, and give the parents of newborn babies a bundle of essential items.
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 in the first round, the second preference votes of those who supported her were redistributed.
Secretary of State for Wales, Tory MP Alun Cairns, welcomed the new first minister, saying he looked forward to working closely with him “to secure a stronger economy in communities right across Wales”.
Leader of the Welsh Conservatives in Cardiff Bay, Paul Davies, gave qualified congratulations, saying Mr Drakeford “has a huge task ahead of him in solving the problems our nation is experiencing after decades of failure from successive Labour-led governments”.
“While Mark Drakeford has a mandate to lead from the Labour Party, he has no mandate to lead from the Welsh people; only a Welsh Assembly election will provide an opportunity for the public to endorse, or otherwise, his plans,” he added.