BEIJING — An American businesswoman accused of spying has been formally arrested in China shortly before President Xi Jinping’s trip to the United States, her husband and a family lawyer said on Tuesday, adding to the brew of disputes that have dulled expectations for the visit.

State security officers secretively detained the businesswoman, Phan Phan-Gillis, also known as Sandy, about six months ago while she was accompanying a delegation of officials and businesspeople from Houston in southern China. But her case had gone unreported until Monday, after her husband learned of her formal arrest and decided to speak out and deny that her work as a consultant could have involved spying.

Ms. Phan-Gillis’s husband, Jeff Gillis, said he received the news on Sunday, two days before Mr. Xi was to arrive in Seattle. The timing appeared to be coincidental, but Mr. Gillis said he hoped that Mr. Xi’s visit would open opportunities for the Obama administration to press for her release after months of secretive and fruitless efforts on his own.

“It is the most stupid politics in the world to arrest a U.S. citizen the week that Xi Jinping is coming to the United States for a state visit on political charges of spying,” he said by telephone from Houston, where the couple live.