The 27-year-old gunman accused of killing two people on Thursday outside a synagogue in eastern Germany had planned for even more carnage.

According to an 11-page manifesto by Stephan Balliet, which appears to have been released online before the attack, Balliet’s main aims were:

“1. Prove the viability of improvised weapons.

2. Increase the morale of other suppressed Whites by spreading the combat footage.

3. Kill as many anti-Whites as possible, Jews preferred.

Bonus: Don’t die.”

But in a 35-minute video of the attack that he filmed with a head-mounted camera and live-streamed online — in a move eerily similar to the mosque mass shooting in Christchurch, New Zealand, in March — Balliet’s deadly aims were repeatedly thwarted when he couldn’t enter the synagogue and when his homemade guns repeatedly jammed and failed to fire.

“I have certainly managed to prove how absurd improvised weapons are,” he said at one point during the live stream, as he grew increasingly frustrated with his weapons.

In another instance, his purportedly homemade shotgun repeatedly jammed in a kebab shop he stormed, though he still shot dead one man in the shop.

The gunman could have caused far more death and destruction had his improvised weapons not jammed. Nonetheless, these kinds of homemade guns — often called “ghost guns” because they are unlicensed and nearly impossible to trace — are increasingly a factor in crime and extremist attacks worldwide, according to experts.

“People have been improvising weapons forever,” said Mark A. Tallman, who teaches at Colorado State University at Pueblo’s Center for the Study of Homeland Security and has written a history of ghost guns. “Making guns is relatively low technology.”

But while the DIY gun-making trend was once part of an “obscure gun nerd subculture and gun rights protest movement … in the last few years, we’ve seen extremists gravitate toward it,” Tallman said.

He said these kinds of improvised, homemade weapons are particularly “appealing to criminals and extremists at the lower rungs of the ladder.” Compared with larger militias or terrorist groups, these people are often more isolated and operating alone without access to logistical support and networks. They may also be looking for a discreet way to acquire weapons, rather than buying a gun at the cost of getting on authorities’ radar.

“But there's also certain risks, like that the gun won't work if it’s not made well,” Tallman added.

The Luty submachine gun Balliet referred to in the video is one of six improvised guns he listed as part of the plan for his attack in his manifesto, released online and analyzed by researchers at the International Center for the Study of Radicalization at King’s College London.

The Luty was first designed by Philip Luty, an English gun fanatic known as the “Home Gunsmith,” who was imprisoned for publishing instructions for making firearms from easy-to-obtain materials (he died in 2011).

Alongside outfitting guns from on-the-shelf materials, 3-D printing is another increasingly talked-about way for people to create their own guns. All that’s needed is a 3-D printer and a blueprint from online sites.

The 3-D guns, made primarily of plastic, aren’t as durable or as powerful as those made from metal, although they can be deadly nonetheless.

All weapons used in Balliet’s attack, and likely all the explosives, were home-manufactured, said a senior German official, who spoke on the condition of anonymity. Investigators have found a 3D-printer at the suspect’s home and established that some components were likely manufactured with a 3-D printer, he said.

The attacker also appeared to have uploaded a set of materials — including raw 3-D printer designs, photos of finished products and some step-by-step instructions — on how to copy his improvised weapons, according to documents obtained by ICSR and shared with The Washington Post.

Balliet could have downloaded instructions or watched videos on how to make the gun from a number of online sites hosted by gun rights activists. He also apparently built crude ammunition from lead bullets, sugar and chlorate power, among other deadly DIY designs, according to the manifesto.

Homemade guns are consequently proliferating, even in countries with tough gun control laws such as Germany. These laws likely prevented Balliet from acquiring more lethal firearms — but ultimately didn’t stop him from making his own.

Germany has some of the world’s strictest gun control laws, requiring, for example, that buyers younger than 25 pass a psychological test and owners be part of a federal gun registry.

Many countries in Western Europe and Asia, as well as Australia and New Zealand, have strict gun control laws and low rates of gun violence. Switzerland has high rates of gun ownership coupled with tough regulations.

Still, illegal guns remain plentiful on the black market across Europe and have been used in previous attacks, such as one in Munich in 2016 that killed nine people.

Firearm deaths are particularly prevalent in Brazil, El Salvador, Honduras and other parts of the Americas where “easy access to firearms, weak regulation or poor implementation of laws designed to combat firearms violence prevail,” according to New York-based Amnesty International.

And among wealthier countries, the United States stands alone with its gun culture and a level of gun violence that Amnesty has dubbed a “human rights crisis.” Nearly 40,000 people in the United States were fatally shot in 2018, according to the Centers for Disease Control and Prevention. Though legal guns are often readily available, “ghost guns” are also increasingly being used in deadly shootings and crime in the country. In California, which has among the United States’ strictest gun control laws, nearly one-third of firearms seized in the state are homemade, according to an investigation by the Trace.

The apparent flaws of Balliet’s improvised weapons “might deter people” willing to copy his manufacturing instructions, said ICSR far-right extremism researcher Blyth Crawford. But with 3D-printing technology constantly evolving, improvised weapons may still pose a growing threat in countries with heavily restricted access to firearms.

Rick Noack in Berlin and Souad Mekhennet in Washington contributed to this report.