(CNN) -- A teen in southern Sweden posted an online threat, saying he would carry out a German-style massacre at his school, police said Thursday.
In his post, the 17-year-old included a photo of himself holding a gun and said he would carry out the attack at the Spykenskolan school in the city of Lund, police spokesman Mikael Persson told CNN.
Police were alerted to the message Wednesday night and took the teen into custody about 6 a.m., Persson said.
The school was notified about the threat, and authorities found an air gun in the teen's home.
On Wednesday, a German teen went on a deadly rampage at his former school in the town of Winnenden in southwest Germany. The 17-year-old opened fire while dressed in military gear.
Seven students and three teachers died at the school; two other students died on the way to a hospital, authorities said.
The gunman killed three other people -- one at a nearby psychiatric clinic, and two at a car dealership -- before police spotted him about three hours and a half hours later.
Police think the gunman then committed suicide, but they are still investigating.