Cervantes lived in Lisbon sporadically in 1581, after that he went to Orán, he come back to Lisbon and, in 1582, he moved to Madrid. How he lived and what he did there remains something of a mystery. Most biographers note that he followed King Philip II there in hopes of gaining an appointment in the royal court. But, while Philip was busy solidifying Spanish rule over Portugal, Cervantes was out of luck.