LONDON — The United Kingdom Parliament has passed the Tobacco and Vapes Bill, legislation that prohibits anyone born after Jan. 1, 2009 from buying cigarettes. The bill cleared both the House of Commons and the House of Lords.

Once the bill receives royal assent, ministers will gain new powers to regulate tobacco, vaping and nicotine products, including their flavors and packaging. The legislation bans vaping in cars carrying children, in playgrounds, outside schools and at hospitals. Vaping will be permitted outside hospitals to support those trying to quit.

The measures do not apply to outdoor hospitality venues such as pub gardens, to wider open spaces such as beaches, or to private outdoor spaces. People will be able to continue smoking and vaping in their homes.

Health minister Baroness Merron addressed the House of Lords as the legislation completed its passage. "This afternoon marks the end of this Bill's journey throughout Parliament," she said. "It is, in fact, the biggest public health intervention in a generation and I can assure all noble Lords it will save lives."

Lord Naseby, a former Member of Parliament, questioned the approach taken in the bill. "What we really need is a proper understanding of how we educate people not to take up smoking," he said.

Merron said the government had engaged with businesses affected by the new rules. "I can overall assure Lord Naseby, as I've done on a number of occasions, about how closely we have worked with retailers, and we will continue to do so," she said.