In 1495, Leonardo da Vinci is thought to have designed and built a humanoid machine called Automaton Knight (“Automa Cavaliere” in Italian) with patronage from Ludovico Sforza, the Duke of Milan at the time.
https://weird-history-facts.com/da-vinci-built-a-robotic-knight-1495/