ISTANBUL — A court in Saudi Arabia on Tuesday sentenced Walid Fitaihi, a doctor who holds dual American and Saudi nationality, to six years in prison on charges that included illegally obtaining U.S. citizenship, a person close to his family said.

The sentencing came despite the Trump administration's repeated appeals to the Saudi government to release Fitaihi, who founded a prominent hospital in the kingdom.

He was arrested in November 2017 as Saudi authorities detained hundreds of business executives, government officials and royal family members. ­Fitaihi was held for nearly two years without trial and tortured while in custody, he told family members.

He was released from custody last year, but Fitaihi and his family remained under a travel ban with their Saudi assets frozen. And he continued to face accusations that human rights groups have called politically motivated.

The sentence imposed Tuesday on Fitaihi was for charges that included obtaining U.S. citizenship without official permission and posting messages on Twitter supporting the 2011 Arab Spring uprisings, according to the person close to the family, who spoke on the condition of anonymity because of the sensitivity of the case.

President Trump, who has warm ties with Saudi Crown Prince Mohammed bin Salman, has been loath to criticize the kingdom’s human rights record. But his administration has made an exception for Fitaihi, raising his plight publicly while at the same time lobbying the Saudi government privately to show clemency, according to people briefed on the discussions.

As recently as October, Secretary of State Mike Pompeo raised the case in public during a joint news conference with Saudi Arabia’s foreign minister.  The two men had “discussed our concerns about American citizens, and we asked for lifting the travel ban on Dr. Fitaihi,” Pompeo said.

In an emailed statement, a spokeswoman for the State Department said “we are disappointed to hear of the sentencing of Dr. Walid Fitaihi and are seeking a full understanding of the ruling against him.”

Two U.S. diplomats attended the court hearing Tuesday, which was held in Riyadh, the Saudi capital, the family friend said. Fitaihi has 30 days to appeal his sentence. In addition to announcing the six-year sentence, the court also imposed an additional six-year travel ban on Fitaihi, his wife and six children, all of whom are U.S. citizens, the friend said.

A spokesman for the Saudi government did not return a message seeking comment on the charges or the sentence. The kingdom has previously denied that Fitaihi was tortured while in custody.

Fitaihi, who was educated at George Washington University and Harvard, is well-known in the kingdom as the founder of a private hospital, a motivational speaker and a television host with millions of followers on social media.

In an interview this year with a Washington Post columnist, Fitaihi suggested his popularity was one of the reasons he had been targeted by the authorities. “They kept asking me, ‘Why do you have so many followers?’ ” Fitaihi said in the interview.

In addition to Fitaihi, at least two other Americans are imprisoned in Saudi Arabia — Salah al Haidar, the son of a prominent Saudi women’s rights activist; and Bader al-Ibrahim, a physician and writer.