 Early in the 16th century, the town came into the possession of the Duchy of Württemberg.Heimsheim was assigned to the district of Weil der Stadt in 1803, and then to in 1807–08.The town remained under Leonberg when the district was recreated on 1 October 1938.