A UPS worker who is suspected of threatening a mass shooting at the company's facility in Silicon Valley ranted during a livestream as he led authorities on a chase Sunday night.

NBC Bay Area obtained a video showing Thomas Andrews, 32, livestream his rant as he was driving with officers close behind.

"So this is how it ends," he could be heard saying. "We knew it would. We knew I would get arrested."

Andrews was wanted after a fellow UPS employee showed police text threats Andrews sent that investigators said indicated he planned a mass shooting at his workplace. Andrews did not make specific threats during the livestream, but he did make strange references.

"UPS is a great company," he said. "But some people are tainted."

Detectives who searched Andrews' apartment in Sunnyvale found 20,000 rounds of ammunition, five tactical-style rifles, a shotgun, three handguns and body armor. Several backpacks containing ammunition were found by the front door, Sunnyvale police Capt. Dan Pistor said.

"What we know from what was recovered, it had the appearance of a situation that could be carried out," Deputy District Attorney Mike Vidmar said.

Some friends of Andrews said they believe he may have just been showing off, but they did acknowledge they had no idea he collected firearms or ammunition.

"Understand this is a show for everyone to see," Andrews said in the video.

Andrews was booked for investigation of making criminal threats, evading police, driving under the influence and several counts of weapons violations.

He is scheduled to be officially charged in court Thursday.

The Associated Press contributed to this report.