When Chinese Buddhists brought texts from India back to China, they brought some Tantric texts too. Tantric Buddhism had become widespread in northeastern India from around 500 to 1200 CE.
In China itself, however, Esoteric Buddhism was persecuted under the rule of a Tang Dynasty emperor, around 840 CE.
After that, Esoteric Buddhism continued in Japan, where it had been brought from China earlier in the 9th century.