 Pius at first attempted to take a cautious approach in dealing with Napoleon.With him he signed the Concordat of 1801, through which he succeeded in guaranteeing religious freedom for Catholics living in France, and was present at his coronation as Emperor of the French in 1804.In 1809, however, during the Napoleonic Wars, Napoleon once again invaded the Papal States, resulting in his excommunication.