Porn sites must check age of users or risk facing sanctions from July.
The UK will become the first country in the world to bring in age-verification for online pornography when the measures come into force on 15 July 2019.
It means that commercial providers of online pornography will be required by law to carry out age-verification checks on users, to ensure that they are 18 or over.
The first time they visit, users will have to create an AgeID account by verifying their ID, with an email and password.
Websites that fail to implement age-verification technology face having payment services withdrawn or being blocked for UK users.
The British Board of Film Classification (BBFC) will be responsible for ensuring compliance with the new laws.
Minister for Digital Margot James said: “Adult content is currently far too easy for children to access online. The introduction of mandatory age-verification is a world-first, and we’ve taken the time to balance privacy concerns with the need to protect children from inappropriate content. We want the UK to be the safest place in the world to be online, and these new laws will help us achieve this.”
BBFC Chief Executive David Austin said: "The introduction of age-verification to restrict access to commercial pornographic websites to adults is a ground breaking child protection measure. Age-verification will help prevent children from accessing pornographic content online and means the UK is leading the way in internet safety.
“On entry into force, consumers will be able to identify that an age-verification provider has met rigorous security and data checks if they carry the BBFC's new green 'AV' symbol."
It follows last week’s publication of the Online Harms White Paper which set out clear responsibilities for tech companies to keep UK citizens safe online, how these responsibilities should be met and what would happen if they are not.