The first inhabitants in the area arrived about 9,000 years ago. Physical evidence (pollen grains) indicates agriculture from ca. 1000 AD, but there are no historical records. Up to the 13th century, the area was a borderland between the hunting grounds of Finnish Proper and Tavastian Finns, with a sparse population. Immigrants from Sweden established permanent agricultural settlements during the 12th and 13th centuries, assimilating the sparse local Finnish-speaking population. Espoo was a subdivision of the Kirkkonummi congregation until 1486-7. The oldest known document referring to Kirkkonummi is from 1330; Espoo as a subchapter has been dated to the 1380s, although the first document directly referring to Espoo is from as late as 1431. The construction of the Espoo Cathedral, the oldest preserved building in Espoo, marks the independence of Espoo. Administratively, Espoo was a part of Uusimaa. When the province was split to Eastern and Western provinces governed from the Porvoo and Raasepori castles, respectively, the eastern border of the Raasepori province was in Espoo. The 13th century road connecting the most important cities in Finland at that time, the King's Road passes through Espoo on its way from Stockholm via Turku and Porvoo to Viipuri.
In 1557, King Gustaf Wasa decided to stabilize and develop the region by founding a royal mansion in Espoo. The government bought the villages of Espåby and Mankby (Finnish: Mankki) and transferred the population elsewhere, and built the royal mansion in Espåby. (Mankby was eventually abandoned and was never repopulated.) The royal mansion housed the king's local plenipotentiary (vogt), and collected royal tax in kind paid by labor on the mansion's farm. The administrative center Espoon keskus has grown around the church and the Espoo railway station, but the municipality has retained a network-like structure of to the modern day.
In 1920, Espoo was only a rural municipality of about 9,000