A US citizen has been found dead in a provincial Egyptian jail, six weeks after being arrested in Egypt's restive north Sinai peninsula, Egyptian officials have confirmed.

James Henry Lunn, 66, is the second foreigner to die in police custody since the July overthrow of Mohamed Morsi, and one of several to have fallen foul of Egypt's brutal and labyrinthine judicial system this summer.

Lunn was first detained on 29 August in Sheikh Zuweid, North Sinai, an area in which the Egyptian army is currently waging a controversial counter-insurgency against Islamist extremists.

Lunn aroused suspicion because he had allegedly broken curfew, and because he was carrying "a map of Egypt and a very hi-tech electronic device", said Badr Abdellatty, a spokesman for Egypt's foreign ministry.

Following his arrest, Lunn was taken to a jail in Ismailia, a city on the Egyptian mainland, where he had been detained without trial ever since. Thousands of Egyptians also remain detained without charge following this summer's mass arrests of Morsi supporters.

Egyptian prosecutors said Henry was found dead in a prison bathroom on Sunday morning, and appeared to have taken his own life.

A US official in Cairo confirmed that "a US citizen prisoner in Ismailia died from an apparent suicide".

His death follows the alleged murder by fellow detainees of a Frenchman in a Cairo police station in September, and the 50-day incarceration of two Canadian activists, who were subjected to several instances of torture before being released last week.

Anti-American sentiment is not rare in Egypt, where demonstrators breached the walls of the US embassy last autumn in protest at a film about the prophet Muhammad. An American was also stabbed outside the embassy this spring.

But xenophobia has risen since the overthrow of Morsi, as his opponents sought to portray his overthrow as a nationalistic act, and his allies as foreign insurgents – aided by America.

• This article was updated on Monday 14 October in light of information from the US embassy. A prosecutors' report misstated Lunn's name, referring to him only by his first names, James Henry. The US embassy denied earlier Egyptian statements suggesting that Lunn was a former US army officer. However, a James Henry Lunn claimed in a book published last year to be a former intelligence officer in the US army.