The memristor is a foundational device for an artificial synapse, which is essential to realize next-generation neuromorphic computing. Herein, an optoelectronic memristor based on a two-dimensional (2D) transitional-metal trichalcogenide (TMTC) is designed and demonstrated. Owing to the excellent optical and electrical characteristics of titanium trisulfide (TiS3), the memristor exhibits stable bipolar resistance switching (RS) as a result of the controllable formation and rupturing of the conductive aluminum filaments. Multilevel storage is realized with light of multiple wavelengths between 400 and 808 nm, and the synaptic properties such as conduction modulation and spiking timing-dependent plasticity (STDP) are achieved. On the basis of the photonic potentiation and electrical habitual ability, Pavlovian-associative learning is successfully established on this TiS3-based artificial synapse. All these results reveal the large potential of 2D TMTCs in artificial neuromorphic chips.