In 1788, Charles IV became king of spain,however,he left his valido (royar advisor),Manuel Godoy,in control of the goverment. At the beggining of the XIX, Godoy allowed Napoleon to pass trough Spain so he could conquer Portugal. However,the French took control of Spain instead. Napoleon took king Charles IV and his family to France. Napoleon named ( Josep I ), his brother, king of spain.