On the day Baz Gul’s world was shattered, he was out scavenging garbage with his 10-year-old son, hoping to earn a few dollars to provide for his family of five.

He and his son were arrested on Sept. 12 in the Pakistani city of Karachi during a raid on Afghan migrants. Mr. Gul, 30, was born and raised in Karachi and married his wife there. But as the son of refugees who fled to Pakistan in 1992, he is a citizen of Afghanistan — and no longer welcome in the country of his birth.

His wife, Ram Bibi, 29, also an Afghan citizen, sold valuables to hire a lawyer who could argue that Mr. Gul was a legal resident of Pakistan. But he was deported to Afghanistan on Nov. 13, after Pakistan set a deadline for all 1.7 million illegal migrants to leave, most of them Afghans. Mr. Gul is now stranded in a country he does not know, leaving his pregnant wife and his children at the mercy of impoverished relatives to survive.

The Gul family is one of hundreds that have been torn apart, rights activists say, as refugees from Afghanistan have poured out of Pakistan, heeding the deportation order or being forcibly removed under a crackdown that followed a rise in tensions between the two countries.

Some of the Afghans being deported are married to Pakistani women but were unable to get Pakistani citizenship. Others, like Mr. Gul, are married to Afghan women and are being expelled separately from their families after being arrested while out working or commuting. Many of those deported were born in Pakistan, which does not confer automatic citizenship on people born there.

After the expulsions, husbands and wives, parents and children, wonder when, or if, they will see each other again. Separated from a primary breadwinner, many must now fend for themselves.

“Families that are being separated — particularly women and children — will fall into the cracks of exploitation,” said Saeed Husain, a Karachi-based anthropologist who studies migration.

A climate of fear has fallen over Afghan refugee communities as the Pakistani government has carried out its deportation campaign. In the narrow alleys of the Karachi slums, the police move through homes, day and night. Inside markets, they search people with specific attire and appearances. On the roads, they make random stops to check identity documents.

Once apprehended, the Afghans board buses, police vans and even three-wheel rickshaws, headed to a feared destination: a detention center enclosed in barbed wire and guarded by armed officers. Behind these walls, the migrants learn their fate, out of view of journalists and rights activists.

Most of the Afghans confront collective deportation, returning to a homeland many of them have never seen, one where the Taliban are back in power and finding employment is difficult.

The crackdown intensified after Nov. 1, the deadline that Pakistan set when it announced a month before that unregistered foreigners must leave. More than 300,000 Afghan migrants, many of whom had resided in Pakistan for decades, have been forcibly returned to their homeland or have gone there voluntarily to avoid arrest and expulsion, according to Pakistani government statistics.

A group of Pakistani politicians and rights activists filed a petition in the country’s Supreme Court on Nov. 2, challenging what they called the government’s inhumane decision to expel illegal immigrants. The court rejected the petition, saying it did not raise any issues of fundamental rights.

The Pakistani authorities say they are enforcing immigration laws the same way any other country would. They say that they are not repatriating Afghans with valid documentation, and that deported people can apply for visas to reunite with relatives.

Still, families divided by the expulsions are facing wrenching choices. Gharib Nawaz, an Afghan baker born and raised in the Pakistani city of Peshawar, was arrested on Nov. 3 and subsequently deported because he lacked temporary documents needed for legal residence.

His wife, Nargis, a Pakistani national who uses one name, said her husband had thought that getting the documents would hurt his chances of becoming a citizen of Pakistan. But he was never able to gain citizenship: While foreign women who marry Pakistani men can become citizens under the law in Pakistan, there is no provision for foreign men who marry Pakistani women.

Now, Nargis, 28, must decide whether to remain in Pakistan, away from her husband, the family’s sole breadwinner, or to take their two daughters to Afghanistan, leaving her parents behind for a country where she has never set foot and where education is restricted for girls.

“My daughters aren’t willing to go to Afghanistan” and forgo their futures, she said.

She vented her anger at the Pakistani government, saying that while it cannot manage runaway inflation or militant attacks, it “is surprisingly efficient in tearing apart happy families and separating fathers from their children.”

Nargis is particularly concerned about the deteriorating relations between Pakistan and Afghanistan, which are related primarily to a sharp increase in attacks inside Pakistan by fighters based across the border.

“I am afraid that such a hostile situation will make it difficult for my husband to re-enter Pakistan and reunite with his family,” she said.

The expulsion of some Afghans is prodding other family members to return to Afghanistan, too. Noor Khan, 55, a laborer at a vegetable market in Karachi, where he arrived from Afghanistan in the late 1980s, said he had decided to go back to Kabul by the end of November, even though he has temporary documentation that allows him to live legally in Pakistan.

On Nov. 4, one of Mr. Khan’s sons, Shahbaz, 20, was arrested after he left home to buy groceries. Shahbaz, who lacked documentation, called two days later from Spin Boldak, an Afghan border town, telling his family of his deportation. Shahbaz had no money or contacts in Afghanistan, but Mr. Khan arranged for him to stay with a distant relative in Kabul.

Mr. Khan said he would go to Kabul to avoid a potential forced expulsion. “I know that after undocumented migrants, it is our turn,” he said. “It’s a difficult decision, but it’s better than facing humiliation at the hands of the police in Pakistan.”

For the family of Mr. Gul, the garbage scavenger in Karachi, one lesson from his deportation was the futility of fighting the authorities.

After he and his son were arrested, they were taken to a police station. The boy was freed after the family paid a bribe, they said. But officials tore up a photocopy of Mr. Gul’s Afghan Citizen Card, a document issued by the Pakistani government allowing Afghan refugees to stay legally, the family said.

Nawaz Kakar, a relative who had found the father and son in the police station after they did not return home, said he showed the police Mr. Gul’s original citizenship card, but they would still not release him.

Mr. Gul went to court, where he received a two-month sentence, a $34 fine and a deportation order to be carried out after he served his sentence. But once the government started forced deportations at the Nov. 1 deadline, Mr. Kakar said, the jail authorities coerced Mr. Gul into putting his fingerprint on a document stating his willingness to be repatriated to Afghanistan.

A senior police official denied the accusations of bribery and document tempering, asserting that claims like these are fabricated by illegal migrants seeking to avoid deportation.

Mr. Kakar said the family’s main concerns now were who will care for Mr. Gul’s wife and children and whether Mr. Gul will be able to return to Pakistan. “Since Gul’s arrest, I’ve been assisting his family with food, but I can’t fully support them,” said Mr. Kakar, a father of five who earns $5 a day.

He said that, as Afghan citizens, Mr. Gul’s wife and children live in constant fear, unable to sleep peacefully, worried that they could be awakened any morning by a knock on the door.