The Senedd has given the green light for a overhaul of Welsh bus services, putting ministers in the driving seat to decide routes, timetables and fares.
MSs voted 34-10, with two abstentions, in favour of a bill to replace the current system in which private operators decide most routes on a commercial basis.
A franchising model, similar to London's, will be rolled out as Wales ditches deregulation introduced by the Thatcher government in the 1980s, with a 56% fall in journeys since.
Under the bus bill, which lifts limits on councils running services, the Welsh Government will take control of the network, with Transport for Wales responsible for implementation.
The draft law was introduced because private operators often cut "socially necessary" but unprofitable routes, leaving people stranded and forcing ministers to step in with subsidies.
'Landmark'
The new system, which has been about a decade in the making, will be introduced in phases over about five years in four regions, beginning in south-west Wales in 2027.
Services in the south east of Wales are expected to follow suit in 2029.
An impact assessment put the total costs of the reforms over 30 years at £623m which was outweighed by estimated benefits of £3.6bn, a return of approximately £5 for every £1 spent.
Ken Skates, Wales' transport secretary, said passing the "landmark" bill will put people first in the design and delivery of bus services.
He told the Senedd: "It will restore growth to the industry and it will also help to create one network, one timetable, one ticket across public transport."
"Vote for this bill and we will, finally, have the tools to transform public transport for the better in Wales."

'Missed opportunity'
But Sam Rowlands, the Conservatives' shadow transport secretary, depicted the "rushed" plans as fundamentally flawed and overly focused on urban areas.
Warning rural Wales has been neglected, Mr Rowlands said: "One third of the population of Wales live in rural areas, yet there is no clear vision for rural bus networks."
He told Senedd members the franchising model will not work in Wales and risk creating a "one-size-fits-all" system that is "too rigid to respond to local needs".
Mr Rowlands warned smaller bus operators could be pushed out and he bemoaned a "once-in-a-generation" missed opportunity to create an accessible bus network.
Plaid Cymru's Delyth Jewell backed the bill and welcomed amendments to include school transport when planning bus services, with a duty to consider access to education.

'Essential'
Jenny Rathbone, a Labour backbencher, described the bus bill as an "essential measure" to make better use of taxpayers' money through a more rational system.
She said: "Currently, we have to lay on special school buses to transport secondary school pupils...because there's no public bus to get them there. Instead, rival groups of public and private bus providers compete for the most profitable routes."
Ms Rathbone told Senedd members it cost Cardiff almost as much to transport children with additional learning needs (£11.1m) as it did to educate them (£11.3m) last year.
Carolyn Thomas, a fellow Labour politician, said the bill will address the issue of operators having to be heavily subsidised to take on less lucrative contracts in rural areas.
With no legal challenge expected following the final "stage-four" vote on Tuesday, the bill – which was delayed by the pandemic – should receive royal assent in the coming weeks.

Vueling withdraws winter flights to Aicante this winter
Playground in Barry forced to close after fire damages equipment
Campaigners Take Fight for Fairer Pathways in Welsh Women’s Football to Parliament
Vale Councillor Gwyn John Launches His First Novel at Llantwit Major Book Signing
Pink poppy display commences with celebration of life
Former Barry office block converted into new homes for people at risk of homelessness
Welsh Government publishes independent report on Level 4 intervention at Cardiff and Vale UHB
Three CoastSnap stations set to be installed along the Glamorgan Heritage Coast
Daffodil Runner statue installed at Marie Curie Hospice in Penarth
Woman Dies After Incident in Leckwith as Police Investigation Continues
Vale entrepreneur wins national Innovate UK award for sustainable construction technology
Cardiff Airport retains top accessibility rating as regulator reports record demand for assistance
Open Doors event to showcase hidden world of Glamorgan Archives
New details have emerged of a new tree-lined public square that will replace a traffic dominated junction
Dyffryn Gardens’ Edwardian rose garden blooms again after decade-long restoration
Barry’s Own Daniel White to Walk 190 Miles Back to Where His Round Table Story Began
1,300 people attend Flying Start Family Fun Day
Dispersal order put in place to tackle anti-social behaviour
Interim Chief Executive Appointed at Cardiff and Vale University Health Board
Cardiff Theatre Marks 50 Years of Service for Long‑Standing Staff Member