<Tr> <Td_colspan="2"> Political subdivisions </Td> <Td> Upper Louisiana; Lower Louisiana </Td> </Tr> <Tr> <Td_colspan="2"> Today part of </Td> <Td> Canada United States </Td> </Tr> <P> Louisiana (Spanish: Luisiana, sometimes called Luciana) was the name of an administrative Spanish Governorate belonging to the Captaincy General of Cuba, part of the Viceroyalty of New Spain from 1762 to 1802 that consisted of territory west of the Mississippi River basin, plus New Orleans . Spain acquired the territory from France, which had named it La Louisiane in honor of King Louis XIV in 1682 . It is sometimes known as Spanish Louisiana . The district was retroceded to France, under the terms of the Third Treaty of San Ildefonso (1800) and the Treaty of Aranjuez (1801). In 1802, King Charles IV of Spain published a royal bill on 15 October, effecting the transfer and outlining the conditions . </P> <P> However, Spain agreed to continue administering the colony until French officials arrived and formalized the transfer (1803). The ceremony was conducted at the Cabildo in New Orleans on 30 November 1803, just three weeks before the formalities of cession from France to the United States pursuant to the Louisiana Purchase . </P>

How did spain acquire louisiana including new orleans
find me the text answering this question