After the defeats of Jena–Auerstedt, the Kingdom of Prussia was invaded and Berlin was occupied by the French. The Court of Prussia fled to Königsberg, asking Russian help. Russia interfered and this led to the bloody battle of Eylau and battle of Friedland in 1807. The French won and signed the Treaties of Tilsit.