Hana al-Za'anin and her husband, Tamer, have not set eyes on each other, let alone had physical contact, for almost seven years. But the young Palestinian couple are delighted to be expecting their first child in January.

The baby – a boy already named Hassan – is not a modern-day miracle but the result of medical science combined with old-fashioned subterfuge. He was conceived after Tamer's sperm was smuggled out of an Israeli prison, across a stringent military checkpoint into Gaza, and impregnated into an egg harvested from Hana at a fertility clinic in Gaza City. The resulting embryo was transplanted into her uterus.

Hassan will be the first "prison baby" born in Gaza, but he will join at least three infants delivered in the West Bank as a result of a rapidly growing sperm-smuggling phenomenon, driven by women desperate for babies, and doctors willing to advise on transportation and to provide IVF treatment at a reduced or waived cost. Dozens of prisoners' wives, including several in Gaza, are reported to be pregnant.

According to Abdul-Karim al-Hindawi, the Russian-trained fertility doctor who assisted Za'anin's pregnancy, the procedure is straightforward. "She is like any other woman who wants to be pregnant. The only difficulty was getting the sperm. It took about six hours to reach us, and it's unusual for sperm to be outside the body for that long," he said at his private clinic in Gaza City.

"We gave the family some advice on how to pack it. The best way is wrapped in plastic or in a small vial, and carried between the breasts, where it's warm and dark. Then we freeze it as soon as it arrives," he said.

Za'anin and her parents-in-law were coy on the details of how the sperm was passed from her husband across the notoriously tight security of Israeli jails. Another family may have been involved, and the wrapped sperm disguised as an everyday object permitted in the visitors' room.

The 26-year-old mother-to-be had been inspired to seek help from the al-Basma fertility centre after hearing of a prison baby born in the West Bank.

Za'anin, who had been denied permission by Israel to visit her husband in prison since his conviction on four counts of aiding in attempted murder and for membership of the militant organisation Islamic Jihad just a few months after their marriage, consulted him by phone. "He was surprised that I asked. He had also heard about this, and had wanted to ask me, but thought people might wonder about me being pregnant with my husband in jail. So when I asked, he agreed right away," she said at the family's home in Beit Hanoun.

"I was very confident that everything would be OK, I don't know why," said Za'anin. "I called Tamer to say I was pregnant, and I could hear cheering. We are very happy. I need to be a mother. Every woman needs to be married and have children. In our society, this is the role of women."

Within months of the couple's wedding in 2006, the groom – now 28 – was in jail, joining two of Za'anin's brothers. Another of her brothers was killed in 2004. Her husband's family expect him to serve his full 12-year sentence.

Za'anin has been given permission to visit her husband only once, after she became pregnant. She declined, fearing that prison x-ray machines and scanners could harm her foetus.

Over recent decades, hundreds of thousands of families in Gaza and the West Bank have experienced the imprisonment of a relative, ensuring this is a visceral issue for the population. According to Addameer, a Palestinian prisoners' rights organisation, last month there were 5,007 Palestinians in Israeli jails and detention centres, including 12 women and 180 minors.

Palestinian leaders insisted on the release of long-serving prisoners as a condition of returning to peace talks this year. The first group of prisoners were released in August; the next tranche of 25 – out of a total of 104 – will be freed at the end of this month.

In the West Bank city of Nablus, fertility expert Salem Abu Khaizaran has helped prisoners' wives to become pregnant using sperm smuggled from prison. Three babies, all boys, have been born at the Razan Medical Centre.

A spokeswoman for Israel's prisons service said there was no evidence that sperm had been smuggled out of jails. "We doubt this can be done because of the security and rules for visitors for Palestinian prisoners. We doubt anyone got pregnant this way," she said.

Back in Gaza, Hindawi said all Palestinians felt solidarity with the prisoners and their families. "I was happy to do something to help," he said. Having carried out the IVF treatment at a discounted price, he hopes to deliver Za'anin's baby himself.

For Za'anin, 12 years was simply too long to wait for a child. But she does not plan to repeat the smuggling experience. "After Hassan is born, I can wait for five years to go through pregnancy again," she said.

She hopes to be able to take her son to meet his father, although it depends on the Israeli authorities granting permission. And – eventually – Hassan will hear the story of his conception. "Of course I will tell him, I am proud of this. And I want him to know."

• The article was amended on 15 October 2013 to include details of Tamer's criminal record.