CAIRO — Evidence gathered in an investigation into the crash of EgyptAir Flight 804 in the Mediterranean Sea in May indicates that the plane most likely broke up in midair after a fire near or inside the cockpit that quickly overwhelmed the crew, according to Egyptian officials involved in the inquiry.

But the officials could not determine whether the fire thought to have caused the crash had been set off by a mechanical malfunction or by a malicious act.

The findings are based on information from the Airbus A320’s flight data recorder and cockpit voice recorder — commonly known as black boxes — along with an analysis of the condition and distribution of recovered debris, including human remains, according to forensic and aviation officials in Cairo. The officials spoke this week on the condition of anonymity because they were not authorized to discuss the investigation publicly.

The officials said the evidence appeared to be sufficient to rule out at least one early theory: that a pilot had deliberately flown the plane into the water.