Some of the babies and children had been sexually abused, Agboola Dabiri added.
It is not uncommon for Nigerian authorities to raid "baby factories".
In some cases, unmarried pregnant women are promised healthcare, only for their children to be taken away. In others, women are raped and made pregnant.
The babies can be sold for adoption, used for child labour, trafficked to Europe for prostitution or killed for ritual purposes.
In February, Lagos police told local media they had uncovered a case where a pregnant woman went to a private home to have her baby delivered - only for the baby to be taken away and sold.
Speaking after the latest raids, Mr Dabiri, the Commissioner for Youths and Social Development in Lagos State, said 100 girls and 62 boys had been rescued.
"The children and teenagers rescued from the 'baby factory' and homes were placed at government-approved homes for care and protection," he added.
In 2013, 17 pregnant teenagers and 11 babies were rescued from a house in south-eastern Imo state. The girls said they had been raped by one man.
In 2012, a UK judge raised concerns about "desperate childless parents" being caught up in baby-selling scams in Nigeria.
There was evidence that women were going to Nigeria seeking fertility treatment, then being sold unwanted babies, the judge said.