The first trains were rope-hauled, gravity powered or pulled by horses, but from the early 19th century, steam locomotives powered almost all. From the 1920s onwards they began to be replaced by less labor intensive and cleaner diesel locomotives and electric locomotives.