Sixteen and 17-year-olds will be able to take part in the 2021 Welsh Assembly election after a vote by members.
Legislation overhauling assembly elections will give the vote to 103,000 more people, with the franchise also extended to foreign nationals.
The assembly will also be renamed Senedd Cymru/Welsh Parliament as part of the changes.
The law was passed on a knife-edge by 41 assembly members, just exceeding the two-thirds majority of 40 votes needed.
While Labour and Plaid Cymru backed the bill, the Conservatives and Brexit Party opposed it.
The decision was backed with the help of Presiding Officer Elin Jones and Deputy Presiding Officer Ann Jones, who do not normally take part in Senedd votes.
Elin Jones said the law will “empower young people to participate in the democratic process”.
“This bill, in my view, will create a more inclusive, diverse and effective Senedd,” she said.
But the inclusion of votes for foreign nationals, following Welsh Government amendments earlier in the process, upset the Conservatives despite some having backed votes for 16-year-olds.
Former Tory group leader Andrew RT Davies called it a “stitch-up” by the “left-wing political establishment”.
The changes will come into effect at the next assembly election, while the assembly’s name will change in May 2020.
Will 16-year-olds vote?
Tabitha Anthony, 18, is studying for A-Levels in Tondu near Bridgend and plans to vote Conservative. She said she did not think 16-year-olds “would be mature enough to do their own research”.
“There are a handful of people in my school who are 18 and are able to vote but they’re not politically aware enough,” she said before Wednesday’s vote.
“I’ve heard in our common room lots of people discussing politics, but they’re trying to describe and explain the different policies to each other when really you’re just hearing the propaganda that’s being spread.”
Lara Evans, 19, from Tredegar, said she “100%” would have voted at 16. “I think 16 is a completely responsible age to give people the vote,” the politics student said.
The Plaid Cymru supporter added: “If people feel that they don’t want to vote at 16 then they don’t have to vote because the likelihood is if you’re not interested in politics – maybe you don’t feel you align with any party or strongly enough.
“That’s the same whether you’re 16 or a lot older… it depends how involved you are in politics rather than what your age is.”
Geraint Williams, 19, from Cardiff, said: “Young people are definitely more engaged in politics.”
The musical theatre student, who is undecided but leaning towards Labour, added: “We’re realising that it’s our future and we are the future generation and that we have the opportunity to make the final decision.”