A man has been arrested after he tackled a 12-year-old boy from behind and stabbed him in the neck inside a McDonald's outlet in downtown Pittsburgh.

The child, whose identity was not revealed, was standing in line with his parents when the stabbing took place Saturday afternoon. The accused, identified as 51-year-old Charles Edward Turner, was in the queue behind the victim. He tackled the child from behind before stabbing him in the neck.

"It's really quite a tragic thing on a beautiful Saturday downtown. He was with his family, he was standing in line, they had just zipped in for one quick thing," said Cara Cruz, the deputy public information officer for the Pittsburgh Public Safety Department, told WKRC-TV.

Soon, police and medics arrived at the scene and rushed the boy to a nearby hospital in critical condition.

When the officers tried to take Turner into custody, he resisted arrest by punching and kicking them. He was eventually arrested. Turner appeared in court and was charged with criminal attempted homicide, aggravated assault, simple assault and resisting arrest. He was being held in the Allegheny County Jail.

A box cutter was recovered from the scene during the investigation, NBC-affiliated television station WPXI reported. Police don't believe the victim and the accused knew each other. The motive behind the crime was not known.

Jerry Dean, who witnessed Turner's arrest, told WKRC-TV, "I noticed there was a bunch of police cars here, and as we were approaching it looked like they were bringing out a gentleman in handcuffs. It’s scary. I have a 15, soon-to-be 16-year-old and I just thought what if she could have been in there getting something to drink or whatever."

People residing in the area were shocked and scared when they heard about the incident.

"I think it's terrible that something like that can happen. It just goes to show you, that you have to be very careful these days, wherever you are, wherever you go," said Anthony Benson, a resident.

The victim remained in the hospital as of Sunday and was reported to be in a stable condition.

The outside of a McDonald's store is pictured. AFP / Alastair Pike