An illegal Chinese immigrant who miscarried twins after being hustled off for deportation by federal authorities in Philadelphia last year will be allowed to stay in the country permanently, a judge has ruled.

The case sparked protests in two U.S. cities and headlines as far away as Beijing.

"I feel happy, very excited," Zhen Xing Jiang, 33, said yesterday. "I don't need to hide now."

Jiang's husband said the Philadelphia couple would like to resume a normal life, perhaps even running their own restaurant, as they had in the past. He said he hoped the decision would bolster his case for permanent residency.

"Finally, finally, we can settle down and make a living," said Tian Xiao Zhang, 36. He said their two young sons were overjoyed.

Jiang "is now allowed to stay in America," said her attorney, Richard Bortnick of the Cozen O'Connor law firm, reading from the order of federal Immigration Judge Barbara Nelson. "Her status is changed from illegal status to legal status."

The decision came Tuesday during a hearing in New York, he said. People connected to the case had not expected the ruling.

The thought was that Jiang's request for political asylum might be combined with her husband's in Philadelphia. But Nelson saw no reason for that, the government offered no opposition to the petition, and "within five minutes it was all over," Bortnick said.

"The government acknowledged that mistakes had been made," he said, "and that the family unit remaining together is paramount."

Jiang entered the United States illegally in 1995, coming from Fujian province on China's southeast coast, and for nearly a decade helped her husband run their Chinese restaurant in Philadelphia. On Feb. 7, 2006, she was 13 weeks pregnant with twins when she arrived at the Center City immigration office for what she expected to be a routine interview.

Instead, as her family sat unaware in the lobby, Jiang was taken into custody and driven to New York's John F. Kennedy Airport for immediate deportation.

The effort to expel her was halted when Jiang, complaining of stomach pain, was taken to a hospital and doctors learned she had miscarried.

In interviews, Jiang said she was roughly shoved into a van in Philadelphia and that her pleas for medical help were at first ignored - allegations the government denied.

The incident provoked demonstrations here and in New York. Immigration activists were galvanized by photos of the frail-looking Jiang in a hospital bed, an oxygen mask over her face, her anguished husband standing beside her.

In Philadelphia, the Asian American community organized the Justice for Jiang Zhen Xing Campaign to publicize the case to try to build support for immigration laws that would not separate illegal immigrants from their U.S.-born children.

"It's great news," Helen Gym, a board member of Asian Americans United and a leader of the campaign, said of the ruling. "We celebrate with Mrs. Jiang, but there's still a lot of concern."

What's needed are more humane immigration laws, Gym said. And, she added, she's worried that Jiang's husband may still face difficulty in his bid to stay in the country.

Both applied for asylum based on China's one-child birth-planning policy, which they maintained could result in severe punishment were they to return to their homeland. Those grounds are frequently claimed but not often upheld. The couple's sons, William, 8, and Jason, 6, were born in the United States and are citizens.

Yesterday, Zhang said he believed that his wife's successful petition would influence his case. In the meantime, he was thrilled she would be able to stay in the country.

"I appreciate the judge," he said. "They had mercy on us."