Nikhom Thephakaysone, 30, of San Francisco, was arrested on suspicion of murder outside his home in the nearby Oceanview neighborhood on Tuesday, police said.
A source tells ABC7 News, police found a lot of guns at the suspect's house.
Valdez, 20, also a San Francisco resident, was originally from Garden Grove in Southern California.
He was shot around 9:50 p.m. as he left an eastbound San Francisco Municipal Railway light-rail vehicle near Randolph and Bright streets, according to police. The M-Ocean View line stops at that corner.
School officials said Valdez was a sophomore who had started at SF State in the fall of 2012 and had not yet declared a major.
University president Les Wong said in a statement today, "This is truly a tragedy for Justin's friends and family, and for the entire University community. I have reached out to Justin's family to offer our heartfelt concern, and to assure them that we stand ready to offer support and assistance at this difficult time."
Grief counseling is available on campus for students, faculty and staff.
Valdez had attended Garden Grove High School and lived with his uncle, his high school principal Steve Osborne said.
Osborne recalled a "passionate and persistent" student who was the president of the school's environmental club and a top competitor in the Garden Grove High aquatics program.
While Valdez was a student, he would talk with Osborne frequently to see about changes to the school's recycling program, the principal said.
He also pushed tirelessly to establish a "Lights Out Wednesday" program to cut the school's carbon footprint, according to the principal.
Vigils will be held in Valdez's honor at the high school's pool deck on Friday and Sunday, and there will be a "Lights Out for Justin Day" in the coming days, Osborne said.
"It's been devastating for teachers who knew him," Osborne said.
According to Valdez's Facebook page, he was a member of the SFSU Men's Club Water Polo team.
Police have released video footage of the shooting suspect captured by a surveillance camera on the Muni train.
He is described as an Asian man between 20 and 30 years old with a stocky build, who was wearing a black baseball cap with a purple brim and logo, according to police.
He was also wearing a white fleece hooded jacket with gray lining, blue jeans and black running shoes with white trim, police said.
The motive for the shooting remains under investigation. Police said the suspect and Valdez did not appear to know each other.
Anyone with information about the case is asked to call the Police Department's homicide detail at (415) 553-1145. People can also call anonymously to (415) 575-4444 or send a tip by text message to TIP411 with "SFPD" in the message.