It was modeled on one of the great Chinese monasteries of the time and built for a Chinese monk who was said to have interceded with the dreaded Kublai Khan to stop the Mongol invasion of Japan .
The Mongol invasion of Japan was a failure .