The king appointed Fernando, Duke of Alba, as captain general of his army. The duke was 73 years old and ill at the time. Fernando mustered his forces, estimated at 20,000 men, in Badajoz, and in June 1580 crossed the Spanish-Portuguese border and moved to Lisbon. In late August he defeated a Portuguese army at the Battle of Alcântara and entered Lisbon. This cleared the way for Philip II who became Philip I of Portugal, and created a dynastic union spanning all of Iberia under the Spanish crown.