NEW BRAUNFELS, Texas (AP) — An anonymous donor has provided $500,000 to post bail for a teen jailed since April on a terroristic threat charge for writing on Facebook that he was going to “shoot up a kindergarten.”

Comal County Jail officials confirmed 19-year-old Justin Carter was released Thursday. His attorney, Donald Flanary III, tells the San Antonio Express-News the donor contacted the defense team with an offer to help. Flanary wouldn’t identify the donor.

Carter said in a letter to a judge from jail that what he wrote in his Feb. 13 Facebook was “terrible, mean and downright stupid.” He told the judge that “the misunderstanding was that I wasn’t trying to scare anyone, I was trying to be witty and sarcastic. I failed and I was arrested.”