An earthquake early warning was activated four seconds after the mainshock initiated. Residents in Kangding, 53 km (33 mi) away, were given seven seconds of warning before shaking occurred. At Ya'an and Chengdu, 20 seconds and 50 seconds of warning were given, respectively.