Duke of Milan Hires da Vinci
In 1482, Leonardo left Florence to enter the service of Ludovico Sforza, the Duke of Milan. Under Sforza, Leonardo painted, sculpted, and made designs for machinery, weapons, & buildings. He also did several studies on geometry, construction, canals, and architecture, designing "everything from churches to fortresses." Though he did some traveling and advising on other projects during this time, Leonardo lived in Milan and worked for the Duke until his fall from power in 1499.
Source: https://buffaloah.com/a/virtual/italy/milan/sforza/leo.html