"If you believe in God, let them go" he said in an open letter to Tehran's prosecutor, Jafar Dolatabadi, adding that he would turn himself in if they were released and if he would be tried in a "just court."
Mostafaei's wife and her brother, Fereshteh and Farhad Halimi, were arrested on July 23 and judiciary officials have said that they won't let them go until he gives himself up.
Mostafaei's colleagues tell RFE/RL he's come under pressure for defending Sakineh Mohammadi Ashtiani, a woman who was sentenced to death by stoning after being convicted of adultery.
Mostafaei says in his letter, which was e-mailed to several people, that he learned about the "unlawful" arrest of his wife and brother-in-law on July 24 through his father-in-law.
The same day, he had been summoned to Evin prison and interrogated. After he left Evin, he says he received a phone call and was summoned again.
He said he was planning to go to Evin the next day, but changed his mind after he learned about the arrests of his loved ones. He accuses a district prosecutor, Shahid Moghdas, of abuse of power in their arrest.
"I'm forced to bear being away from my wife, my daughter, and my family so that maybe laws will justly rule in our country," Mostafaei said.
Mostafaei, who has defended dozens of children on death row, says his only concern in recent years has been to save the lives of individuals who have been unjustly sentenced to death. He adds that he's managed to save the lives of 18 child offenders.
Human Rights Watch called on Iran on July 30 to stop harassing and intimidating Mostafaei, "who has spent his career defending juveniles and the underprivileged, including many who were sentenced to execution."
-- Golnaz Esfandiari