EAST JERUSALEM — For two decades, Wafa Issa has lived like a prisoner in her own home on the gritty outskirts of this ancient city. Her world is her kitchen, her six children and the stables out back where the family keeps Arabian horses.

She said she doesn’t venture beyond her front porch, even to buy groceries, for fear that anywhere she goes, she could be detained and deported back to the Israeli-occupied West Bank, just 15 minutes away.

“It’s like I’m under house arrest, or like a cat in a cage,” she said.

It’s a sacrifice Issa has made to be with her East Jerusalem-born husband, who is a legal permanent resident of Israel. As a Palestinian born in the occupied territories, she has not been entitled to join him despite their marriage. Even if her husband were a full citizen of Israel, the legal right to live with her family still would be out of reach.

Human rights advocates say that Israel’s 18-year-old ban on family reunification, known as the Citizenship Law, turns a fundamental right — to live with one’s spouse and children — into a crime and runs counter to immigration policy in other developed countries. Advocates also say it is discriminatory because it largely does not apply to Israeli Jews, who rarely marry Palestinians.

Issa and thousands of other couples, however, now see a rare opportunity. Recently, Israeli lawmakers unexpectedly failed to renew the ban, spurring a race by advocacy groups and Palestinian couples to file for hundreds of residency permits with Israel’s Interior Ministry, according to Israeli media and advocates. But the window may soon close again because the law still has widespread support among lawmakers.

The family reunification ban was passed in 2003 as a temporary security measure in the wake of the Palestinian uprising known as the second intifada. The law has been renewed every year since. Israeli politicians have recently acknowledged that measure continues to win support in part out of a desire to maintain Israel’s Jewish majority.

Of the many challenges Palestinians face, the ban poses a particularly intimate one because it has left so many families in emotional limbo. Life is marked by painful choices. Some people choose to live apart from their families, missing a lifetime of moments, or divorce under pressure. Others, like Issa, live without papers, at constant risk of deportation.

Israel allows couples to apply for temporary residency, and officials report that they have granted 12,700 such permits. Advocates estimate that the actual number of families affected is more than double that.

The Issa family, for example, has applied three times for temporary residency for Wafa but said she has been rejected every time. An application filed eight months ago is still pending. And even if she did receive a temporary permit, she still wouldn’t be eligible for a driver’s license, social security or many other government benefits.

Human rights advocates say that Palestinians from East Jerusalem, occupied by Israel in the 1967 war, are often among those affected by the Citizenship Law because of their close family and geographic connection with West Bankers. Unlike Palestinians born in Israel, most of East Jerusalem’s Arabs are not citizens but permanent Israeli residents.

Mahmoud Akhrass, a 46-year-old Palestinian born in the West Bank city of Nablus, said that when he married a woman from East Jerusalem in 2005, he didn’t think about how the difference in their status would affect their relationship. But he recalled that his future mother-in-law issued him a warning: Don’t take my daughter away to the West Bank, where security and mobility are less than in Jerusalem.

They settled just outside the security wall that separates much of East Jerusalem from other occupied territory. Soon, Akhrass’s wife became pregnant, and, as a permanent Israeli resident, sought medical care in Israel. But Israeli authorities denied Akhrass’s temporary residency application because he was younger than 35. (Men under 35 and women under 25 are not eligible.)

When it came time for his wife to give birth, he could not go to the hospital, which was only a short drive away, Akhrass said. For two days during his wife’s labor and recovery, he paced their apartment anxiously, unable to concentrate. He called his wife’s family so many times that they asked him to stop.

In 2010, he was finally granted a temporary permit. Each year when he goes to renew it, he fears that one tiny mistake on his application could result in its being taken away.

Although Wafa Issa has managed to stay under the radar, some families are awakened to a knock on the door by Israeli police, said Jessica Montell, the executive director of HaMoked, a group that has challenged the ban in Israel’s Supreme Court. Neighbors call the police on their neighbors; other times, it is a spouse who wants a convenient way out of the relationship.

The spouse with papers has all the power in the marriage, advocates say, and the resulting stress can lead to domestic abuse and divorce.

Earlier this year, the Arab feminist organization Kayan documented killings by the husbands of two Palestinian women illegally in Israel. “You start seeing a pattern,” said Rafah Anabtawi, general director of Kayan. “The women who are the most harmed often don’t have papers because they are trapped.”

Fadwa, a 46-year-old West Bank woman who spoke on the condition that her last name be withheld for her safety, said she lived illegally in Jerusalem with a physically abusive, drug-addicted husband who often threatened to report her to the authorities if she didn’t comply with his demands. She said she stayed in the marriage for the sake of her two Jerusalem-born children, afraid of losing contact with them if she were deported.

“My situation is that I live in Jerusalem, my girls, my life, are in Jerusalem,” she said. “I do not live in the West Bank, but my permit says that that’s where I am from. He knows that.”

The family reunification ban, initially justified as a security measure in response to the Palestinian uprising, has survived numerous legal challenges. Few human rights advocates expected that the new Israeli government — led by two supporters of the law, Prime Minister Naftali Bennett and Foreign Minister Yair Lapid — would not renew the law when it came up for a routine vote this month.

But the issue turned into an early test of whether the governing coalition, which includes parties from across the political spectrum, could win parliamentary passage for priority bills. Recently ousted prime minister Benjamin Netanyahu, a longtime proponent of the law, sought to challenge the government and encouraged lawmakers in his right-wing Likud party to oppose it. The measure fell just short of the votes needed after a debate that lasted well into the night.

When Issa first read on Facebook that the law wasn’t renewed, she raised her hands and cried, “The doors of heaven have opened, praise to God!” she said. She thought about her mother in the West Bank, whom she hasn’t visited in years.

But the ministry that issues permits is run by Ayelet Shaked, a right-wing lawmaker who has said she will continue to block residency for most Palestinians from the occupied territories and is working to bring the law to another vote.

Issa said she realizes that her new hopes may be crushed.

“The government is racist, I know,” she said. “But I am an optimist.”

Sufian Taha contributed to this report.