The Mosavis were victims of a hardening in Norwegian government policies and popular attitudes toward asylum seekers. Their daughter, Aghdas, had been the first to reach Norway, arriving in 2011 at age 13 with a group of migrants after she was separated from the family in Turkey. The Norwegian authorities then paid for her parents and siblings to fly to join her on family reunification grounds, in 2012.

Norway has now become the most determined of all European countries to expel Afghan asylum seekers. Ninety percent of Afghan asylum claims are rejected as invalid, according to the Norwegian Organization for Asylum Seekers, compared with 40 percent to 50 percent in most European countries.

Norway has returned 442 Afghans this year, 278 of them against their will, said Bjorn Frode Skaaret, the migration attaché at the Norwegian Embassy in Kabul. Other European countries have had more repatriations this year, but none are known to have had so many forcible ones.

Aghdas, now 18 and in her final year of high school, was allowed to stay in Norway on humanitarian grounds because she had established a strong connection to the country through years of schooling. But she might give up plans to study nanotechnology at college, she said, so she can work and send money to her family in Afghanistan. She has already found a part-time job at a 7-Eleven store in the town where the family had settled, Fredrikstad.

Their lawyer said members of the family who were sent back to Afghanistan had a similar claim, especially because the two boys have had nearly all their formal education in Norwegian, making them poorly equipped to rejoin Afghan society.

“My opinion is the Norwegian government has broken the law,” said Sigrid Broch, their lawyer. “It’s a very integrated family in every way. It’s heartbreaking, especially for Massoud, who has never been living in Afghanistan in any way since age 2.”

The family was deported on Massoud’s seventh birthday, and it had arranged a party for him, complete with trampolines and other activities. The nine children who were invited were mostly Norwegians, including his best friend, Hans. Massoud was deported before anyone could warn the guests the party was off.