Classical Greece was millenia ahead of the rest of the world. Pindar writes of the automata found in Rhodes:
The animated figures stand
Adorning every public street
And seem to breathe in stone, or
move their marble feet.
There was even a working steam engine in Alexandria before it was burned down:
http://en.wikipedia.org/wiki/Aeolipile