Magellan lost the favor of the king of Portugal when he became involved in a political entanglement. This refers to his involvement in the quagmire of political intrigue at the Portuguese court, which led to his dismissal from service by the king of Portugal. After losing the king's favor, Magellan offered to serve the future Emperor Charles V of Spain.