A German man who trained in Pakistan with an offshoot of Al Qaeda and confessed in 2009 to plotting to bomb American targets in Germany was released from prison this week.

The decision to grant early release to the leader of the plot, Fritz Gelowicz, comes as the country grapples with the aftershocks of two recent attacks in Bavaria by people claiming loyalty to the Islamic State.

Mr. Gelowicz, 36, was sentenced in 2010 to 12 years in prison. Counting time served before his sentencing, he had been in prison for nearly nine years and was eligible for early release based on good behavior and because he was no longer deemed to be a danger, according to Andreas Vitek, a spokesman for the Düsseldorf Higher Regional Court. Mr. Gelowicz will have to report regularly to a probation officer.

The court in Düsseldorf released Mr. Gelowicz on Monday, but the decision did not receive widespread attention until Wednesday, after his defense lawyer, Dirk Uden, wrote about it on his website.