Complex sentence: In 1839, he was elected a member of Cortes for the first time for Málaga, and in 1840 he was made a general of division and commander of the district of Valencia, which he relinquished to take his seat in congress.
Split into simpler sentences: In 1839, he was elected as a member of Cortes for the first time for Málaga. In 1840 he was promoted to the rank of general of division and commander of the district of Valencia, which he relinquished to take his seat in congress.