The first attack took place just south of Würzburg in northern Bavaria.
On July 18th Riaz A., a 17-year-old asylum seeker from Afghanistan boarded a train and started attacking passengers with an axe before fleeing into the night. He attacked another woman before police shot him dead.
Riaz A. had arrived in Germany without his parents and, according to investigators, had done nothing which would suggest he was a potential terrorist.
Six days later Mohammed D., a 27-year-old asylum seeker from Syria, detonated a bomb in Ansbach, also in northern Bavaria, and killed himself while injuring over a dozen other people.
Bavarian authorities found evidence that both men had links to the terror group Isis.
Now the Süddeutsche Zeitung has published the contents of chats the two men had with Isis agents, although it does not mention where it received the information.
In Riaz A.'s conversation with his Isis contact the teenager tells the man that he wants to carry out the attack with a knife and an axe.
“Would it not be better to use a car, brother?” the Isis agent asks.
The teenager responds that he doesn't know how to drive. The Isis agent encourages him to learn.
“The damage would be considerably bigger,” he explains.
But Riaz A. says he “wants to enter paradise tonight.”
On the night of the attack the teenager is in contact with the Isis agent right up until the point of the attack. He encourages him to use an axe rather than a knife and assures him that Isis will take responsibility.
Just before he begins Riaz writes: “I'm starting now.”
The contact replies: “Now you will get into heaven.”
Six days later Mohammed D. had picked out Ansbach Open 2016, a music festival in the small Bavarian town, as his target. Again he was in contact with an Isis agent, the SZ reports.
“This place will be full of people,” Mohammed D. writes.
“Kill them all in a big area so that they all lie flat on the floor,” his contact responds.
But when the Syrian arrives at the festival he apparently hesitates due to security controls in place at the entrance.
“Search out a spot and run into the crowd. Break through the police and run for it,” the contact writes.
When Mohammed D. still hasn't acted, the contact tells him: “Forget the festival and find a restaurant. What is wrong with you? I'd do it if there were two people there. Trust in God and go to the restaurant.”
At the restaurant Mohammed D. fatally wounded himself when he detonated the device. A further 15 people were injured.
After the two attacks a special police commission was set up in Bavaria to investigate how Isis aim to carry out terror attacks in Germany, the SZ reports.
The investigators in this commission believe that the jihaidsts search out potential recruits on the internet and then help them pick out targets and incite them to murder.
Contact with the Ansbach and Würzburg attackers is believed to have taken place over a period of months.
Arrests which took place on Tuesday in northern Germany also indicate that Isis has used the refugee routes to smuggle terrorists into Germany.
Three men with fake Syrian passports were arrested at refugee homes in Lower Saxony and Schleswig-Holstein.
Interior Minister Thomas de Maiziere said that the men had used the same smuggling network to enter Europe as that used by the men who killed 130 people in terror attacks in Paris in November.