The gunman who shot a 15-year-old boy in the neck on a Queens subway train, leaving his victim paralyzed, was arrested Thursday after NYPD detectives found him hiding out in Virginia, police and prosecutors said.

Matthew Rodriguez, 18, was hit with attempted murder, assault and weapons possession charges for the April 27 shooting aboard an A train approaching the 80th St. station in Ozone Park, cops said.

Cops from an NYPD warrants squad arrested Rodriguez after he was extradited to New York City from Virginia, where he fled after the shooting, officials said.

The teen’s family was glad that Rodriguez was finally arrested.

“Oh, great,” the victim’s great aunt, Carol Wilson, said when reached by the Daily News. “I feel great. I’m glad.”

Queens prosecutors say Rodriguez shot his 15-year-old victim as the latter fought with the defendant’s friend on the train.

The friend, who is 16, had shot the victim in the left leg on Feb. 7 during a clash inside a building on Everdell Ave. in Far Rockaway, not far from where the victim used to live, police sources said.

Police arrested the shooter in March and charged him in the February shooting, but the Brooklyn District Attorney’s Office declined to prosecute after the victim refused to testify.

Investigators believe the victim confronted the suspect from the February shooting after running into him on the Manhattan-bound A train, sources said. The suspect was armed but did not pull his weapon at first, police sources said.

The two teens fought. Rodriguez then lifted his friend’s pants leg, where the firearm was hidden, grabbed the pistol and opened fire, Queens Assistant District Attorney Kevin Timpone said Friday.

Rodriguez was caught on “crystal clear” subway car surveillance video shooting the 15-year-old boy in the back. When the teen fell, Rodriguez pointed the gun at the boy’s face and fired again, Timpone told Queens Criminal Court Judge Bruna DiBiase.

As Rodriguez and his sidekick left the train car, the victim had “streams of blood spurting out of his neck,” Timpone said.

Gravely wounded, the teen was rushed to Jamaica Hospital, where relatives said he was put on a ventilator.

“He’s on a ventilator. He’s paralyzed,” the boy’s mother told the Daily News after the shooting. The heartbroken mom didn’t want to be identified, fearing for her family’s safety. “He is conscious,” she said.

One of the bullets hit the teen’s spine, leaving him paralyzed from the waist down, his mother said. As the family keep vigil by his bedside, he’s only able to communicate through handwritten notes, she added.

When reached Friday, the victim’s mother declined to comment on Rodriguez’s arrest. Nor would she offer an update on her son’s prognosis.

Law enforcement sources say the victim has been linked to multiple robbery patterns and has a criminal record that includes numerous arrests.

The April shooting caused a mass panic on the subway car with straphangers stampeding toward the exits as the train entered the station.

“This was an unacceptable incident,” Mayor Mamdani said in a statement after the incident. “Violence like this has no place on our subway system, and my administration is committed to doing everything in our power to make every New Yorker — especially children — safe on their daily commutes.”

The 16-year-old suspect who fought with the victim was arrested three days after the shooting, and was also charged with attempted murder, assault and weapons possession, cops said.

At Rodriguez’s bail hearing, Timpone said the 18-year-old suspect had fled to Virginia, where he hid for more than a month before NYPD detectives tracked him down.

“(He) represents the very definition of a flight risk,” Timpone said.

Judge DiBiase ordered Rodriguez held without bail. He is expected to return to court on June 23.