A longstanding conspiracy theory that the Nazi war criminal Rudolf Hess was replaced by a doppelganger in prison has been debunked.

For years, there were rumours that the prisoner known as Spandau #7 at the Berlin jail was an impostor substituted in to take the place of the deputy Führer of the Third Reich.

But now scientists say analysis of blood samples from Spandau #7 and a living relative of Hess has put an end to the theory. The inmate was Hess after all.

“No match would have supported the impostor theory, but finally we got a match,” said Prof Jan Cemper-Kiesslich, of the University of Salzburg, a co-author of the research.

Hess was captured after a solo flight and parachute landing in Scotland in 1941, where he apparently hoped to negotiate a peace deal. He was held at various locations including the Tower of London before being tried at Nuremberg and given a life sentence.

Facebook Twitter Pinterest Rudolf Hess in Spandau prison in 1986. Photograph: Sipa Press/Rex Features

He arrived at Spandau in 1947 and remained there until his apparent suicide in 1987, by which point he was the jail’s sole prisoner.

But an enduring rumour before Hess even reached Spandau was that the inmate was a doppelganger. The study’s authors say his doctor at Spandau prison was among those who believed the theory, pointing to doubts about his journey to Scotland, his refusal to see relatives until 1969 and his “claimed amnesia”.

The theory was also believed in the highest echelons of political life, including by the former US president Franklin Roosevelt. Hess’s family, however, disputed the idea.

Writing in the journal Forensic Science International Genetics, Cemper-Kiedslich and colleagues report that their conclusion is based on analysis of a blood sample taken from Spandau #7 in 1982. The sample was hermetically sealed on a microscope slide kept for years for teaching purposes by another of the study’s authors, Rick Wahl, a former US army pathologist.

It was a fortunate situation: Hess’s body was disinterred and cremated in 2011 to avoid his grave becoming a site of pilgrimage for neo-Nazis.

The team tracked down a distant male relative of Hess, whose identity they are careful to protect. According to the New Scientist, which first reported on the study, the man agreed to give a DNA sample and the team compared it with that of Spandau #7, looking at DNA markers across the genome..

Cemper-Kiesslich told the Guardian the key was to look particularly at the Y-chromosome. “Usually the DNA markers that are used for paternity testing don’t work out for distant relatives. But on the other hand we knew that both sample donors [if Spandau #7 was Hess] shared a common paternal line,” he said.

With Y-chromosomes passed down from father to son, that offered the possibility of a different analysis. “Persons with an unbroken paternal line display the same set of DNA markers on the Y chromosome,” said Cemper-Kiesslich.

The authors say the people who carried out the analysis were unaware of the story of the samples until after the results were in.

The results showed that the two people from whom the samples were taken were more than 99.99% likely to be related.

“We are extremely sure that both samples [originate] from the same paternal line,” Cemper-Kiesslich said. “The person the slide sample was taken from indeed was Rudolf Hess.”