The body of a young stowaway was found inside a compartment near the wheel well of a US air force cargo plane that had landed in Germany, leading to questions about the security of an aircraft that had made several stops in Africa.

Air force personnel found the boy’s body on Sunday night after seeing an orange cloth in a small opening next to the landing gear during a detailed inspection of the C-130J aircraft when it landed at Ramstein air base. When they tugged on the wet cloth they discovered it was attached to a boy in the compartment, officials said.

The Pentagon’s press secretary, Rear Admiral John Kirby, said the stowaway was a black male who may have been from Africa. The plane was on a routine mission in Africa and had made stops in Senegal, Mali, Chad, Tunisia and Naval Air Station Sigonella in Sicily before arriving at Ramstein.

A senior US official said on Tuesday that initial indications suggested the boy climbed aboard in Mali. The official was not authorised to speak publicly about an incident under investigation and requested anonymity.

“Security is going to be looked at here. Obviously it would be,” Kirby said. “We try to provide as much security as we can for our aircraft when they’re operating in remote locations and this will all be part of the investigation.”

Some of the airfields where the planes landed were very remote and the security was not always up to the standards followed in the US and other nations, Kirby said. It was unclear how the boy managed to get into the compartment.

“We’ll learn what happened here and if there’s corrective action that needs to be taken, we’ll take it,” he said.

The body was not detected in routine pre-flight and post-flight checks during the trip but was found during a more detailed maintenance inspection of the cargo plane, said Kirby. The body was turned over to German authorities for an autopsy and possible identification.

Tests for communicable diseases had proven negative, Kirby said. An Ebola outbreak in west Africa has killed at least 670 people, the largest outbreak in history with deaths blamed on the disease in Sierra Leone, Liberia, Guinea and Nigeria.

In April a Somali immigrant survived a flight from San Jose international airport in California to Hawaii stowed away in the wheel well of a Boeing 767 commercial airliner.