An al Qaeda-worshipping teen from Somalia apparently posted an online rant against the United States on Monday morning — then plowed his car into a crowd of students at Ohio State University and swung at others with a butcher knife, wounding 11.

The attacker, Abdul Razak Ali Artan, 18, was fatally shot within moments of his rampage by a campus officer at the Columbus school, according to authorities. He was a student there.

Just three minutes before the attack, Artan — a refugee who lived in Pakistan before moving to the US with his family in 2014 — is believed to have posted a rant online in which he blasted America and hailed US-born al Qaeda cleric Anwar al-Awlaki as a “hero.”

“I am sick and tired of seeing my fellow Muslim brothers and sisters being killed and tortured EVERYWHERE,” reads the post, which ABC News said was uploaded to a Facebook account believed to be Artan’s.

“I can’t take it anymore. America! Stop interfering with other countries, especially the Muslim Ummah,” the post reads, using the Arabic word for community. “We are not weak. We are not weak, remember that.”

Warning that he had reached his “boiling point,’’ the post adds, “Stop interfering with other countries . . . [if] you want us Muslims to stop carrying lone wolf attacks.”

ISIS, a breakaway branch of al Qaeda, recently published an article in its English-language magazine, Rumiyah, that encouraged lone-wolf attacks, noting that using vehicles can reap “large numbers of casualties.”

“[Artan] did exhibit some of the methods encouraged by terror groups who can’t attack the US themselves,” a federal source told The Post.

Hours before Monday’s bloody assault, Artan also wrote, “Forgive and forget. Love.”

The mayhem unfolded at 9:52 a.m., when Artan drove over a curb and rammed his silver Honda Civic into a group of people who had evacuated the school’s Watts Hall after reports of a gas leak, officials said.

Officials do not believe the reported gas leak was related to the attack, according to reports.

Artan then got out of his car, which is registered to a family member, and started stabbing people with a butcher knife, officials said.

Police issued an “active shooter” alert that prompted a campus-wide lockdown, with a tweet from the university’s emergency management department chillingly ordering students to “Run Hide Fight.”

Some students barricaded themselves in classrooms, while others made a run for it.

Campus cop Alan Horujko, who was in the area investigating the gas leak, sprang into action, shooting and killing Artan almost immediately.

“We all owe a debt of gratitude to [Horujko],” said Monica Moll, director of the university’s Department of Public Safety. “He did a fabulous job today.”

The 11 injured included Professor Emeritus William Clark, four graduate students and three undergraduates. One person was critically injured, officials said.

Jacob Bower, an Ohio State sophomore, was sitting on a bench about 100 feet away from the morning’s chaos and saw people running for their lives.

“I heard someone yell, ‘He’s got a knife!’ And I saw a guy with a big-ass knife just chasing people around,” Bower told NBC News. “When I saw that, I grabbed all my stuff and started running.”

The officer who responded shouted at Artan, “Drop it, and get down, or I’ll shoot!” before firing three times, Bower recalled.

“The man was going insane,” Bower said of the attacker.

Ohio State junior Jerry Kovacich said he witnessed Artan try to run over his classmates and then attack them with the large knife after a fire alarm went off, according to The Lantern, the university’s student paper.

“The guy ended up just coming and hopping the curb with his car and trying to mow down a couple people. He lost control, and I think he ended up hitting three people,” Kovacich said.

“Somebody asked him if he was OK, and the guy just hopped out of the car with a butcher knife and starting chasing people around.”

In August, Artan told The Lantern that he was nervous about praying in public on campus.

“I’m a Muslim, it’s not what the media portrays me to be. If people look at me, a Muslim praying, I don’t know what they’re going to think,” he was quoted as saying.

“It’s the media that put that picture in their heads, so they’re just going to have it, and it’s going to make them feel uncomfortable. I was kind of scared right now [of praying in public]. But I just did it. I relied on God. I went over to the corner and just prayed.”

Rep. Adam Schiff (D-Calif.) said Monday’s violence “bears all of the hallmarks of a terror attack carried out by someone who may have been self-radicalized.”

And Rep. Peter King (R-LI) noted that there have been a number of terror-related incidents involving Somali immigrants in recent years.

“We have to gather more facts, but the reality is that there have been significant terror problems with Somali immigrants over the past several years in the United States,” he said.

Artan left Somalia in 2007 and lived in Pakistan before coming to the United States, where he became a legal resident, according to federal sources.

He spent time in a temporary shelter in Dallas before settling in Ohio, NBC News reported.

Artan had studied at nearby Columbus State Community College for two years, graduating cum laude, then transferred to Ohio State.

Additional reporting by David K. Li and Post wire services