An Iowa high school teacher who was placed on administrative leave last week after he posted a threatening comment on social media about the climate activist Greta Thunberg has resigned, the school district confirmed on Friday.

The teacher, Matt Baish, who taught chemistry at West High School in Waterloo, Iowa, said on Facebook on Oct. 2 that he would not attend a rally featuring Ms. Thunberg because he didn’t “have my sniper rifle.”

In a statement on Friday, the school, which announced on Oct. 4 that Mr. Baish had been placed on leave pending an investigation, said that he had resigned Thursday, effective immediately.

“West High School and the District are working to ensure classroom instruction continues for courses impacted by the departure,” Tara Thomas, a spokeswoman for the Waterloo Community School District, about 55 miles north of Cedar Rapids, said in the statement.