SANTA CLARA — One person was hit and killed late Monday afternoon by a Caltrain in Santa Clara, roughly 30 minutes after police pulled a trespasser from the tracks in Mountain View, officials confirmed.

The death marked the agency”s 20th fatality of the year, spokeswoman Tasha Bartholomew confirmed, matching a record-high set back in 1995.

The fatal collision happened shortly before 5:40 p.m. just north of the Santa Clara Caltrain station, agency spokeswoman Tasha Bartholomew said. The train that hit the pedestrian was heading northbound at the time of the collision.

Less than 30 minutes before that incident, another person was detained by police near the San Antonio station in Mountain View after they were caught on the tracks and nearly hit by a passing train.

Bartholomew said the person was not hit, but a bag they were carrying was grazed. That person has not been identified.