Denis (Portuguese: Dinis or Diniz), called the Farmer King (Rei Lavrador) and the Poet King (Rei Poeta), was King of Portugal and the Algarve. The eldest son of Afonso III of Portugal by his second wife, Beatrice of Castile, and grandson of king Alfonso X of Castile (known as the Wise), Denis succeeded his father in 1279. His marriage to Elizabeth of Aragon, who was later canonised as a saint of the Roman Catholic Church, was arranged in 1281 when she was 10 years old.
Denis ruled the Kingdom of Portugal and the Algarves for over 46 years and is remembered as a major contributor to the formation of a sense of national identity and an awareness of Portugal as a nation-state. He worked to reorganise his country's economy and gave an impetus to Portuguese agriculture. He ordered the planting of a large pine forest (that still exists today) near Leiria to prevent the soil degradation that threatened the region and as a source of raw materials for the construction of the royal ships. He was also known for his poetry, which constitutes a major contribution to the development of Portuguese as a literary language.