Japan has made the possession of child pornography illegal.
It had been the only member of the G7 group of industrialised nations in which the possession of child pornography remained legal.
Child pornography is banned and subject to penalties in more than 70 countries.
The upper house of parliament voted overwhelmingly for a bill revising laws under which only the production and distribution of child pornography had been banned.
The legislation cleared the lower house earlier this month.
Campaigners had long urged Japan to toughen its stance on child pornography, complaining it was a major source of the material for global markets.
The new legislation bans possession of photographs and videos depicting real children aged below 18, but it does not include drawings or digitally-created imagery.
Now anyone who "possesses child pornography for the purpose of satisfying his/her sexual interest" faces imprisonment of up to one year or a fine of up to one million yen (€7,200).
In order to encourage disposal of material, the penalties will be delayed for one year after the revised law comes into effect, which could happen in July.
The new legislation has "an important message" for consumers of child pornography, said Hiroshi Nakasatomi, associate professor of law at the University of Tokushima.
"In a sense child porn is supplied because there are buyers. Producers will be dealt a severe blow" with crackdowns on the buying side, he told AFP.
The law will also have an educational effect, showing younger generations what is considered good and bad in society, he said.
Following calls to protect freedom of expression, the ban excludes "manga" comics, which are aimed at adults as well as children, "anime" video and computer-generated graphics.
But Prof Nakasatomi said the global trend was to ban drawings or so-called two-dimensional pornography in addition to other forms.
It is "wrong to assume there are no victims" in paedophilic manga and anime since repeated exposure may encourage consumers to act out their fantasies, he said.