The oldest traces of human activity around Keila date back to 3rd or 2nd millennium BC, and about 1000 years ago a settlement appeared on the right bank of the Keila river. In 1219 North-Estonia was conquered by the Danes who established a church on Keila hill in Reval county of Vomentak¿ district. The church, dedicated to the Archangel Michael, was built of wood at first, but was replaced by a stone building at the end of the 13th or beginning of the 14th century. The first written reference to Keila (Keikŋl) appears in the Danish register of 1241.
In the 15th and 16th centuries a couple of dozen houses appeared, housing a hundred or so residents, and around the same time the Livonian Order built a castle on the river bank (where the Jõepark or Riverpark is now). Archaeological digs in the ruins of the castle started in 1976.
Seriously damaged during the crusades of the Livonian war (1558-83), and having suffered terribly during the famine and plague of 1601-1602, Keila remained a small parish village for three centuries. One of the first events that marked the appearance of Keila as a town of cultural note, was the erection of a six-metre high memorial column to Martin Luther near to the church rectory in 1862 (later destroyed in 1949). In 1867 a village school was opened in Väljaotsa farm near Keila, offering a basic education, then in 1885 the first song festival was organised in Keila, with 19 choirs participating, and conductor Konstantin Türnpu from Klooga leading their joint singing.
The development of Keila was given a boost in 1870 by the construction of the Tallinn-Paldiski railway, which opened the way for traders and businesses. The local landowner of the time, Baron von Uexküll started to sell his land for construction in 1896, and several of the buildings around
Between 1950 and 1962, Keila was the centre of the Keila region, and grew rapidly, helped by the electric rail link to
The first post-war town council was elected in 1989 with Andres Pärt as mayor; Since 3 October 2006, Tanel Mõistus has been mayor of Keila.
Keila is a member of the Association of Estonian Cities (since 1935) and the