SB 10.3.51
nanda-vrajam saurir upetya tatra tan
gopan prasuptan upalabhya nidraya
sutam yasoda-sayane nidhaya tat-
sutam upadaya punar grhan agat
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
When Vasudeva reached the house of Nanda Maharaja, he saw that all the cowherd men were fast asleep. Thus he placed his own son on the bed of Yasoda, picked up her daughter, an expansion of Yoga-maya, and then returned to his residence, the prison house of Kamsa.
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
Vasudeva knew very well that as soon as the daughter was in the prison house of Kamsa, Kamsa would immediately kill her; but to protect his own child, he had to kill the child of his friend. Nanda Maharaja was his friend, but out of deep affection and attachment for his own son, he knowingly did this. Srila Visvanatha Cakravarti Thakura says that one cannot be blamed for protecting one’s own child at the sacrifice of another’s. Furthermore, Vasudeva cannot be accused of callousness, since his actions were impelled by the force of Yoga-maya.