At the time, the towns of Menton and Roquebrune-Cap-Martin were part of Monaco. However, the citizens of these towns wanted to be part of France. Charles III gave the towns to France in exchange for Monaco's full independence. A treaty was signed in 1861 which said that France would protect Monaco in case of a war.