CAIRO — As an American imprisoned in Egypt, Mustafa Kassem thought his government would rescue him from what he saw as his unjust incarceration. The 54-year-old auto parts dealer viewed his blue U.S. passport as a bulletproof vest that made him untouchable, especially in the hands of a government that receives billions in American aid, his relatives have said.

By the time he died Monday of apparent heart failure, after more than six years in prison with negligent medical care, Kassem’s faith in American power had broken down. Influential U.S. politicians called for his release but never applied any pressure, such as the threat of sanctions on Egypt’s autocratic leader, Abdel Fatah al-Sissi, a key U.S. ally.

Finally, Kassem saw no choice but to go on a hunger strike in September 2018. In a letter smuggled out of Cairo’s maximum-security Tora prison at the time, he begged President Trump to help him, noting that they were fellow New Yorkers. “I am putting my life in your hands,” wrote the father of two small children.

His death raises questions about the ability of the Trump administration to help as many as a half-dozen Americans still inside Egyptian prisons, most of them for flimsy reasons, according to human rights activists — not to mention the thousands of other political detainees experiencing similarly poor conditions. There are more than 300 prisoners on hunger strike.

On Tuesday, the office of Egypt’s chief prosecutor ordered an autopsy, saying it had opened an investigation of Kassem’s death.

His fatal incarceration is the latest sign of the extent to which the Sissi government has been emboldened by the Trump administration’s policy of keeping silent, at least publicly, about Egypt’s human rights abuses, critics say.

Since Trump’s visit to the Middle East in May 2017, when he made clear that human rights would not be a priority for his administration in its relationships with regional allies, abuses have escalated.

“This sad story reflects very poorly on both Egypt and the United States,” tweeted Michael Hanna, a Middle East expert at the Century Foundation. “And the bilateral relationship remains dysfunctional and directionless.”

Sissi has tightened his grip on the country, putting in place the most authoritarian regime in Egypt’s modern history, human rights activists say. In an effort to silence dissent and free speech, the government has arrested tens of thousands of activists, journalists and political opponents. More than 500 websites deemed critical of the government have been shut down. Extrajudicial killings and forced disappearances of activists are ongoing, as is torture, human rights groups say.

Even as the abuses have multiplied, Trump has continued to embrace Sissi, even declaring him to be his “favorite dictator.” He invited Sissi to the White House, an honor that Trump’s predecessor, President Barack Obama, never extended, largely because of Egypt’s human rights record. In fact, previous U.S. administrations often used the $1.3 billion in U.S. military aid that Egypt receives annually as leverage to press for democratic changes and freedoms.

“Like 1000s of the country’s political prisoners, he should never have been detained,” Sen. Chris Murphy (D-Conn.) tweeted Monday. He urged Secretary of State Mike Pompeo to “remind Egypt that military aid is legally tied to releasing prisoners, including at least 6 US citizens.”

The White House did not respond to requests for comment Tuesday.

David Schenker, assistant secretary of state for Near Eastern affairs, told reporters Monday that Kassem’s death was “needless, tragic and avoidable.”

“I will continue to raise our serious concerns about human rights and Americans detained in Egypt at every opportunity,” he said.

Kassem, of Bethpage, N.Y., was visiting relatives in his native Cairo in the summer of 2013. He was arrested on Aug. 14, 2013, the day Egyptian authorities stormed a sit-in by supporters of the Muslim Brotherhood party in Cairo’s Rabaa al-Adawiya Square, killing as many as 1,000 people, according to human rights groups.

Kassem appears to have been an unintended target: He was arrested at a nearby shopping center, where he had gone to exchange money shortly before his return to the United States, according to the Freedom Initiative, a group that advocates for Egyptian political prisoners.

“After showing his U.S. passport, the soldiers beat and detained him, later transferring him to law enforcement officials who continued this harsh treatment,” Pretrial Rights International, a nonprofit organization that represented Kassem, said Monday. Noting that he was “a diabetic with a heart condition,” the group said that “prison officials limited access to necessary medications and medical care for the entirety of his detention.” It added that Kassem “remained in pretrial detention for over five years.”

Sen. John McCain (R-Ariz.), who died in August 2018, had asked Trump to urge Egypt to release Kassem. In January 2018, after a visit to Cairo, Vice President Pence told reporters that he had spoken with Sissi about Kassem’s imprisonment and that Sissi had “assured” him “he would give that very serious attention.”

Nevertheless, Kassem was convicted and sentenced to 15 years in prison in a mass trial later in 2018, accused along with 738 other defendants of trying to overthrow the Sissi government. The proceedings, said human rights activists, violated all standards of due and fair processes. No evidence directly implicating Kassem was ever presented, they said.

On the day of his sentencing, Kassem began a “liquid-only hunger strike,” said Pretrial Rights International. On Thursday, the group said, Kassem “ceased taking liquids and was shortly thereafter transferred to a hospital, where he passed away” late Monday afternoon.

Senior U.S. officials were aware of Kassem’s deteriorating state. In June, the Working Group of Egypt, a bipartisan group of diplomats and foreign affairs experts, sent a letter to Pompeo, highlighting the poor medical care provided by Egyptian authorities to political detainees. The group wrote that Kassem was “in imminent danger of death.”

The death of former president Mohamed Morsi in June was also a wake-up call for those hoping to assist Kassem and other political detainees.

Morsi, Egypt’s first democratically elected head of state, was ousted in a 2013 military coup engineered by Sissi. He was held for six years in prison under exceedingly harsh conditions, human rights activists and his relatives said, including the denial of medical treatment for his diabetes and other illnesses. The Egyptian government denied the allegations.

In July, Pompeo responded to the letter from the Working Group, saying that “the safety and well-being of U.S. citizens overseas, including those detained, has been a top priority for me.”

He noted that two U.S. citizens detained by Egypt had been released during the Trump administration. In 2017, aid worker Aya Hijazi was freed after Trump pressed Sissi. And the following year, Ahmed Etiwy, a university student, was let go after Pence urged his release.

But other Americans remain incarcerated on what activists describe as dubious charges. Khaled Hassan, a limousine driver from New York, has been imprisoned since January 2018 on charges that he joined an Islamic State affiliate. Hassan has denied the allegations, saying he was in Egypt to visit relatives when he was picked up by security agents.

While he was in custody, security forces allegedly beat Hassan, delivered electric shocks and raped him twice, Human Rights Watch said. In July, Hassan attempted suicide inside Cairo’s notorious Tora prison, the group said.

Last year, Pennsylvania teacher Reem Mohamed Desouky was jailed after she landed in Cairo to visit relatives. Egyptian authorities have charged Desouky with administering social media accounts deemed critical of the government.

Carol Morello in Washington and Kareem Fahim in Istanbul contributed to this report.