During the 11th century, the city of Phitsanulok was but a small Khmer outpost called Song Khwae, meaning two rivers. At that time, the Nan and Khwae Noi Rivers both flowed through the city, making it a strategic gateway to northern Thailand. The urban development of Phitsanulok, which began during the trail end of the era of the Khmer Empire, was to a great extent modeled on the earlier development of the Khmer capital city of Angkor in Cambodia. In fact, Angkor Wat, the chief temple of Angkor, was a temple to the god Vishnu, whereas Song Khwae's forthcoming new name Phitsanu-lok literally means Vishnu's Heaven.