Updated

The suspected gunman who killed eight people and himself Wednesday at a transit rail yard in San Jose, California, was found to have harbored a hatred for his workplace when he was detained by federal officials several years ago. 

Upon returning from an August 2016 trip to the Philippines, Samuel Cassidy, 57, was found with books about terrorism and notes about how much he hated the Valley Transportation Authority, according to a Department of Homeland Security memo obtained by the Wall Street Journal

Customs and Border Protection officials reportedly found a black memo book "filled with lots of notes about how he hates the VTA." His baggage and electronic media were also inspected, the DHS memo said. 

It noted that he had a minor criminal history, citing a 1983 incident in which he was arrested in San Jose and charged with "misdemeanor obstruction/resisting a peace officer," the Journal reported. 

Cassidy worked for the VTA for nine years before he went on a shooting rampage at the rail yard. He took his own life as law enforcement officers responded to the chaotic scene. 

SAN JOSE SHOOTING VICTIMS ID'D; AGES RANGED FROM 29 TO 63

No motive for the shooting has been disclosed. 

"When asked if he had problems with anybody at work, he stated ‘no," the memo reportedly reads. 

Samuel Cassidy, 57, killed nine people at his workplace Wednesday. A memo obtained by the Wall Street Journal said he was found to have a hatred for his workplace while he was detained in 2016 after a trip to the Philippines.

Samuel Cassidy, 57, killed nine people at his workplace Wednesday. A memo obtained by the Wall Street Journal said he was found to have a hatred for his workplace while he was detained in 2016 after a trip to the Philippines. (Santa Clara County Sheriff's Office)

In a statement to Fox News, a Department of Homeland Security spokesman said the agency couldn't comment on the memo "given the ongoing investigation into the shooting in San Jose."

"Under the leadership of Secretary [Alejandro] Mayorkas, in February, DHS commenced a department-wide review which included efforts to ensure law enforcement personnel have the tools and training to identify behavioral indicators associated with targeted violence and policy to improve information sharing with our partners," the spokesman said in a statement.

The newspaper said the memo was distributed within DHS sometime after the shooting. It did not say how long Cassidy was held by federal agents. 

It was not clear if the memo was shared with local law enforcement in San Jose or Santa Clara County or the VTA, which provides bus, light rail and other transit services throughout the county, the largest in the Bay Area and home to Silicon Valley. 

Fox News has reached out to the VTA and Santa Clara County Sheriff's Office. 

CLICK HERE TO GET THE FOX NEWS APP

In a news release Thursday, the Sheriff's Office said Cassidy appeared to be a "highly disgruntled VTA employee for many years," which could explain why he targeted his colleagues. 

Investigators found three 9 mm handguns at the scene and multiple loaded magazines. Cassidy's ex-wife said he had talked about killing people at work more than a decade ago.