Image copyright Mahoning County Jail Image caption Justin Olsen, 18, is charged with threatening a federal law enforcement officer

An Ohio teenager has been arrested for threatening mass violence online, targeting federal agents and Planned Parenthood, court documents said.

FBI agents raided the residence where Justin Olsen, 18, was living, and found more than a dozen rifles and about 10,000 rounds of ammunition.

"Shoot every federal agent in sight," he allegedly wrote, adding he would "stock up" on weapons in another post.

Mr Olsen said his online comments were written in jest, court documents said.

Federal authorities apprehended Mr Olsen last week, just days after the back-to-back mass shootings in Dayton, Ohio and El Paso, Texas rocked the US.

He has been charged with threatening a federal officer and is now being held in federal custody, according to the court filing.

The investigation into Mr Olsen began in February, when the FBI received a complaint about the teenager in Anchorage, Alaska, US media report. Authorities traced Mr Olsen's email address back to Boardman, Ohio, where he was living with his father.

Mr Olsen allegedly praised mass shootings, violence against Planned Parenthood clinics and the Oklahoma City bombing that killed 168 people, on the meme-hosting app iFunny.

In one post, responding to the 1993 Waco siege, a fatal standoff between religious sect the Branch Davidians and federal agents, Mr Olsen allegedly wrote, "in conclusion, shoot every federal agent on sight."

Mr Olsen told agents this post was "a hyperbolic conclusion based on the results of the Waco siege", according to the filing.

According to court documents, Mr Olsen's online account drew FBI attention for its "large increase in subscribers" from February to March of this year.

After Mr Olsen's arrest, FBI found about 300 rounds of ammunition in the stairway of his father's home, and thousands of rounds of additional ammunition, camouflage clothing and a gun vault in a bedroom. Investigators found a machete in the trunk of his car.

It is unclear how much of the weapons and supplies found in the residence could have been accessed by Mr Olsen, and how much belonged to his father.

Mr Olsen is expected back in court on 16 August.