Final answer:
The French gained control of the Louisiana Territory through a secret agreement with Spain and later sold it to the United States.
Step-by-step explanation:
The French gained control of the Louisiana Territory in 1802 through a secret agreement with Spain, represented by option D. In the Treaty of San Ildefonso, Spain transferred the territory back to France, which was then ruled by Napoleon Bonaparte. The French later sold the Louisiana Territory to the United States in the Louisiana Purchase of 1803.
Learn more about French control of the Louisiana Territory in 1802