CAIRO — A deadly insurgency in Egypt that has been directed largely at soldiers and police officers took a dangerous new turn on Wednesday, as a militant group affiliated with the Islamic State said it had beheaded a Croatian expatriate worker who was kidnapped on the outskirts of Cairo last month.

The claim, if confirmed, would represent the first time that the militant group, Sinai Province, had taken captive and killed a foreigner during two years of attacks against the government. A photograph posted on Wednesday on a Twitter account associated with the group appeared to show the victim, Tomislav Salopek, a 30-year-old father of two, beheaded and lying in the desert.

Mr. Salopek’s employer said he was leaving Egypt for a vacation on the day he was abducted and was headed to the airport when gunmen stopped his car.

The apparent killing, which evoked the brutal, videotaped executions by the Islamic State group, was ominous for both Egypt and the region. It provided new evidence that militant groups that have aligned themselves with the Islamic State, also known as ISIS or ISIL, were adopting its tactics. And it was the strongest indication yet that the Egyptian militant group was expanding its focus beyond attacks against the security forces to target civilians and foreigners.