Mr. Kassem was transferred to a hospital in central Cairo last Friday after he began to refuse to take liquids, said Mr. Soltan, who works for the Freedom Initiative, a prisoners’ rights group that represented Mr. Kassem. He died Monday afternoon, leaving behind a wife and two children.

His case had been a focus at the top levels of the Trump administration. On a trip to Cairo in September 2018, Mr. Pence pressed his case with Mr. el-Sisi, as well as that of another imprisoned American, Ahmed Etiwy.

Mr. el-Sisi promised to give “very serious attention” to the matter, Mr. Pence told reporters, “I told him we’d like to see those American citizens restored to their families and restored to our country,” the vice president said.

Egypt is the second-biggest recipient of United States military aid after Israel, receiving $1.3 billion a year. Mr. Trump has regularly lavished praise on Mr. el-Sisi, hailing him for doing a “fantastic job” and calling him “my favorite dictator,” even as the Egyptian leader has overseen Egypt’s harshest crackdown on freedom of speech and political opposition in decades.

For years, Mr. Kassem pinned his hopes for release on the hope that American officials could use that aid leverage to obtain his freedom. But he became disillusioned, relatives said.

“Moustafa saw his blue passport as a shield, his bulletproof armor, which carried the protection and the force of the United States government behind it,” his brother, Mustafa Ahmed, wrote in an article for The New York Times in October 2018.

In April 2017, Mr. Trump pressed the Egyptians to release Aya Hijazi, an American aid worker imprisoned in Egypt. She was quickly brought to the White House amid considerable fanfare. The following year, days after he was sentenced to 15 years imprisonment along with 700 other defendants, Mr. Kassem wrote to Mr. Trump to petition him for help.