A Chinese court has sentenced an American woman to 3 ½ years in prison on spying charges, in a case that has drawn criticism from the United Nations and human rights advocates.

Phan Phan-Gillis was sentenced Tuesday after more than two years in detention, raising the possibility that she may be deported soon and allowed to return to the United States.

Known among friends as "Sandy," Phan-Gillis was detained in March 2015 during a business trip. Her husband, Jeff Gillis, said last year that she was accused of conducting a spy mission in China two decades earlier, then trying to recruit new spies — allegations he called "beyond ridiculous."

The U.S. State Department confirmed the sentencing took place Tuesday.

The Chinese embassy in Washington did not respond to a message.