The Rubik’s cube was invented in 1974 by Ernő Rubik, a lecturer in Budapest, Hungary, primarily to teach spatial relationships to students.
It was, thus, a teaching tool originally but became the largest selling toy of all time.