The troubled teen authorities say killed 17 people at a Florida high school excelled in an air-rifle marksmanship program supported by a grant from the National Rifle Association Foundation, part of a multimillion-dollar effort by the gun group to support youth shooting clubs and other programs.

Nikolas Cruz, 19, was wearing a maroon shirt with the logo from the Army Junior Reserve Officer Training Corps program at Marjory Stoneman Douglas High School when he was arrested Wednesday shortly after the shooting. Former JROTC cadets told The Associated Press that Cruz was a member of the small varsity marksmanship team that trained together after class and traveled to other area schools to compete.

It was a close-knit group. One of the other cadets started calling Cruz “Wolf,” and the nickname stuck.

“He was a very good shot,” said Aaron Diener, 20, who gave Cruz a ride to shooting competitions when they were part of the same four-member team in 2016. “He had an AR-15 he talked about, and pistols he had shot. … He would tell us, ‘Oh, it was so fun to shoot this rifle’ or ‘It was so fun to shoot that.’ It seemed almost therapeutic to him, the way he spoke about it.”

READ MORE: The 17 victims of the Florida high school shooting

The JROTC marksmanship program used air rifles special-made for target shooting, typically on indoor ranges at targets the size of a coin.

Records show that the Stoneman Douglas JROTC program received $10,827 in non-cash assistance from the NRA’s fundraising and charitable arm in 2016, when Cruz was on the squad. The school’s program publicly thanked the NRA Foundation on its Twitter feed.

The JROTC marksmanship program used air rifles special-made for target shooting, typically on indoor ranges at targets the size of a coin.

A spokeswoman for the NRA declined to comment on Friday. The top officers of the foundation are all current or former executives of the NRA.

The more than 1,700 high school JROTC programs nationally also receive financial support from the U.S. military and are typically supervised by retired officers from the Army, Navy, Air Force and Marines. The military collaborates with school systems on the training curriculum, which includes marching drills, athletic competitions and shooting teams.

Cadets wear military uniforms with ranks and insignia’s similar to those of the military branch with which they are affiliated.

Peter Mahmood, the retired Army major who supervises the JROTC program at Stoneman Douglas, did not respond to messages left by phone and at his home.

Authorities say Cruz, who was expelled last year for disciplinary reasons, walked into his former school with an AR-15 and opened fire. He is charged with 17 counts of murder.

The shooting team’s equipment came in handy for some students during the chaos of the rampage. Student Colton Haab told CNN that he led more than 60 students into a JROTC room on campus and barricaded them behind Kevlar sheets used by the rifle program in the event the shooter came after them. In the end, they were not targeted.

Former cadets say they were surprised the awkward teen they remember from a couple years ago now stands accused of slaughtering students and staff. But, in retrospect, there were signs of trouble.

Kyle Ramos, who was the executive officer of the JROTC battalion, said Cruz spoke about guns and knives incessantly and liked to wear military-style clothing to school. He also bragged about shooting animals for fun.

“He told me he would attack little animals with pellet guns and stuff, and I was a little weirded out by that,” said Ramos, now 20. “Like squirrels and lizards and stuff.”

Diener said Cruz sometimes missed target practice because he had detention. There was another time he remembers that Aaron Feis, a member of the school’s security staff, came to get Cruz out of JROTC class because he was in some sort of trouble. Feis, who was also an assistant football coach at the school, is among those Cruz is charged with killing.

The NRA Foundation gave nearly $2.2 million to schools across 30 states in 2016, the most recent year for which its federal tax filings are publicly available. Of that amount, more than $400,000 was in cash grants, while nearly $1.8 million came as in-kind donations ranging from equipment for high school air rifle teams to gun safety programs for younger children.

Most of the schools that receive grants are in public districts.

Along with schools, the NRA Foundation also gives millions of dollars a year to local gun clubs, Boy Scout chapters, churches and agriculture programs. The NRA Foundation has provided more than $335 million in grants since 1990.

Broward County Public Schools, which includes Stoneman Douglas High, has received NRA donations to at least four other high schools, records, show. District officials did not respond to requests for comment Friday.

A total of 18 schools in Florida received NRA donations in 2016, more than any other state.

The rifle team at North Fort Myers High School in Florida received $37,000 in 2016, the largest donation overall. The district’s JROTC program received $10,000 in cash and $27,000 in non-cash assistance two years earlier, according to tax records.

Rob Spicker, a district spokesman, said the grants support JROTC programs that otherwise receive a small amount of money from the U.S. Army. The district has used NRA grants to buy firing range equipment including safety glasses and Kevlar curtains. Spicker said none of the equipment advertises the NRA.

“She told me, ‘Look, he’s not the best of kids, I really hope this program can change him.'”

“If grant money is needed again to support a program that benefits 6,500 students, helps them focus on school, earn scholarships and plan for their future, then we will continue to apply for those types of grants,” he said.

Some of the foundation’s grants also went to elementary and middle schools. The NRA produces a firearm safety program for students through third grade, known for its “Eddie Eagle” mascot. The program teaches children not to touch guns and to run away from them to prevent accidents.

Arsu Noorali, a former JROTC cadet at Stoneman Douglas who participated in marksmanship training, said she hopes the program doesn’t get a bad name because Cruz was in it.

“The program is about discipline, and family and love,” said Noorali, 19. “You hang out with these people, getting up at 4 a.m., and going to competitions, and they become your family.”

Cruz talked of wanting to join the Army after graduation and become an elite special forces soldier, a dream potentially derailed by his expulsion.

Noorali remembers talking to Cruz’s mother about his behavioral problems.

“She told me, ‘Look, he’s not the best of kids, I really hope this program can change him,'” she recounted. “Because it does teach you a lot of discipline. It becomes fun after a while.”