The alleged mastermind behind 9/11 told President Obama that the U.S. brought the 2001 terrorist attack on itself, according to a letter obtained and published Wednesday by The Miami Herald.

The 18-page letter is dated January 2015, but wasn’t sent to the White House until a military judge ordered for it to be delivered just days before Obama left office last month. Officials at the prison at Guantanamo Bay, where he’s a detainee, had refused to deliver the letter because it could be considered propaganda.

“It was not we who started the war against you in 9/11. It was you and your dictators in our land,” Khalid Sheik Mohammed, 51, wrote in the letter.

The letter was addressed to Obama and described him as “the head of the snake” and president of “the country of oppression and tyranny,” the report said.

Get Breaking News Delivered to Your Inbox

One section said, “Why did 9/11 happen? And Why May it Happen Again?”

“The war crimes perpetrated in Palestine since 1948, and those taking place in Gaza today, are the clearest indication of why 9/11 happened, and why it may happen against in the future,” he wrote as an answer in the letter.

Mohammed has been held at the prison at Guantanamo Bay since 2006 after being captured in Pakistan in 2003. During an interrogation in 2007, he confessed to being the mastermind of the 9/11 attacks. Mohammed was subjected to the CIA’s harshest interrogation methods, including waterboarding.

“I will be happy to be alone in my cell to worship Allah the rest of my life and repent to Him all my sins and misdeeds,” he wrote in the letter to Obama. “And if your court sentences me to death, I will be even happier to meet Allah and the prophets and see my best friends whom you killed unjustly all around the world and to see sheik Osama bin Laden.”

The letter also listed a number of U.S. interventions overseas including in Hiroshima, Vietnam, Iran and Iraq to justify the 9/11 attacks, the report said, and condemned Obama for the operation that resulted in the death of Osama bin Laden.

He called Obama “a smart attorney, well acquainted with human rights” who “can kill his enemy without trial and throw his dead body into the sea instead of giving him to his family or respecting him enough as a human being to bury him,” the report said.

Mohammad, meanwhile, is awaiting his death-penalty trial at Guantanamo Bay.