CHRISTIANSBURG, Va. – The result

A judge dismissed a gun charge Monday against a former Virginia Tech student in a Montgomery County case people around the country have been following.

Yunsong Zhao, a Chinese national, is now back in the custody of U.S. Immigration and Customs Enforcement and his future in America is uncertain.

He was accused of having an assault rifle on campus and faced a felony charge.

A judge didn't allow cameras in the courtroom Monday but Zhao, now 20 years old and wearing a suit, put his hands in the air, smiled and said “finally” to his lawyer when the judge said he was dismissing the charge.

The jury trial focused on the size of the magazines in an AR-15 rifle. A Blacksburg detective said he saw Zhao with a magazine he was not legally allowed to use. The judge said there was reasonable doubt about the testimony and decided to rule that Zhao was not guilty and dismiss the 12-member jury.

The at least two dozen supporters who gathered outside the Christiansburg courthouse during the trial said they're glad he's cleared.

“Finally, there is justice for Yunsong Zhao,” said Mike Donovan, president of Nexus Services Inc., a group supporting Zhao. “We have watched as Yunsong has been mistreated, as a case was built against him that was clearly a fallacy, as his liberty was taken away, as he spent six months-plus in prison.”

Zhao’s attorney said she was thrilled with the result.

“He deserves this. It's what's right. It's the truth. I can't be happier for him,” Jessica Sherman-Stoltz said.

The accusation

Police accused Zhao of using a 30-round magazine in an AR-15 rifle while at a shooting range in Montgomery County Jan. 26. It’s illegal for him to use that magazine under Virginia law, because someone who’s not a citizen cannot use a magazine that holds more than 20 rounds.

Zhao was attending Virginia Tech on an F1 student visa.

Under Virginia law, an AR-15 with a 30-round magazine is considered an “assault firearm,” and Zhao faced a Class 6 felony for allegedly “possessing or transporting” it.

Zhao legally purchased the rifle and maintained that he only ever used a magazine holding 20 rounds.

The trial: the prosecution’s case

Before the ruling to dismiss the charge, Montgomery County Circuit Court Judge Marcus Long stated to both legal teams that he had issues with the testimony the prosecution had presented.

The commonwealth put forth three witnesses who testified that Zhao had either illegally used a 30-round magazine or had one in his possession, but the prosecution did not have any physical evidence or documentation that Zhao had used the magazine.

Blacksburg Police Department Detective Brian Wilson’s testimony centered on an observation he made while surveilling Zhao. While dressed in plain clothes, he watched Zhao and Zhao’s friend shoot an AR-15 at a gun range. He said he was certain that Zhao had a 30-round magazine.

Wilson testified that he walked by them, trying not to draw attention to himself, and was four or five feet away when he made the observation.

In cross-examination, the defense emphasized that the detective didn’t take video or pictures and argued that he can’t be certain there was a magazine of that size because he didn’t confiscate the magazine or arrest Zhao that day at the range.

Two store employees testified about various points in the process of Zhao obtaining the rifle, magazines and other items. One employee, a salesman at Whitetail Outfitters in Christiansburg, said Zhao bought one magazine at the store. The employee said he was sure it was a 30-round magazine, but the receipt did not show the magazine’s size.

A manager of Pawn Plus in Christiansburg testified that Zhao legally purchased an AR-15. Zhao ordered the gun online, but, under Virginia law, he had to pick it up and undergo a background check at a licensed retailer. The manager said Zhao received two 30-round magazines with the online order but traded them in at the store for other items before leaving. The manager said Zhao stated that he knew he wasn’t legally allowed to use the 30-round magazines.

The trial: the defense’s case

The defense presented video evidence of Zhao’s day at the shooting range. Zhao’s friend, Tao Tao Wang, testified that he was there with Zhao and answered questions about the video, which shows Zhao firing 20 rounds before taking the magazine out.

Private investigators and another attorney testified to the handling of evidence they kept after Zhao and Wang left the shooting range. The defense showed two 20-round magazines in court that the witnesses said Zhao and Wang had at the shooting range.

Zhao himself took the stand as the last witness. When asked if he owned a 30-round magazine, he responded, “No, I don’t.”

He also stated, “I did not purchase a 30-round (magazine).”

He stated from which stores he bought the 20-round magazines and explained that he looked up all local, state and federal laws before buying the items. He said he knew he could own a 30-round magazine but it would be illegal for him to insert it into his rifle, so, “the safest option is to not own one,” he said.

He was on the stand for six minutes. The commonwealth’s attorney asked him one yes-or-no question on cross-examination.

The trial: the ruling

After the prosecution rested, the defense issued a move to strike evidence, which the judge initially said he’d take under advisement. After the defense rested, Long then granted the motion, leading to the dismissal of the charge. The decision was made before final arguments and before the jury deliberated.

The trial lasted about three hours once the jury was seated.

The protest

Outside the courthouse, more than two dozen people gathered in support of Zhao. Most were with Nexus, a group supporting Zhao and his legal proceedings.

They wore shirts and held signs that said “Free Bellamy,” which is a name Zhao went by in Blacksburg.

“There's a young man who is being treated unfairly, there's no question about it. This case, they’re seemingly trying to make this a terrorist case,” said Frank Jackson, a bishop from Chicago who traveled to Virginia to support Zhao.

The protesters gathered before the proceedings began, and many entered the courtroom later to watch the trial.

What’s next

After spending nearly eight months in custody, Zhao may soon be free, but he faces many potential outcomes in future court proceedings. He remains in ICE custody because his student visa is no longer valid after Virginia Tech dismissed him.

Sherman-Stoltz, Zhao’s attorney, said he could be allowed to stay in the U.S., but a judge in immigration court could also rule that he has to go back to China. She said he has a hearing Thursday in Arlington, Virginia, in immigration court.

Zhao’s attorneys said he wants to stay in America and pursue a law degree. They said he hopes he can use his career to help people. One path to staying in America would be for Zhao to re-apply for a student visa.

Sherman-Stoltz said they will be seeking asylum for Zhao, but didn't elaborate on what grounds. She also said a judge could rule for him to be deported back to China.

Zhao’s attorneys described him as smart and ambitious in their opening arguments in court, and said before his arrest, he had hopes of becoming a law enforcement officer.

Donovan, president of Nexus, called for an investigation into whether the prosecution’s witnesses told the truth on the stand.

“The people who were involved in creating this travesty, they must be held accountable too and I don't care if they wear uniforms or run gun shops. You can't lie and you can't create allegations and charges and cases that harm real people,” he said.

The background

Zhao’s arrest and subsequent court proceedings received national attention. Many people in the community said the accusations surrounding Zhao were concerning. Others defended him, saying the allegations were unfair.

Virginia Tech police reported in late January that Zhao attempted to buy 5,000 rounds of ammo, had been researching bulletproof vests and bought a former police vehicle that still bears some police markings, which he outfitted with a special bumper.

Police also reported that Zhao used a gun locker, sparking a debate about gun storage on or near college campuses.

In a civil lawsuit filed in April, Zhao claimed police targeted him because he is a foreign national.

The lawsuit stated, in part, “This case is about over-eager police trampling over a foreign student's rights because he resembles a student who committed a mass shooting on Virginia Tech's campus in 2007.”

National TV networks and newspapers picked up the story of Zhao’s arrest in January.