The Treaty of Alcañices (1297) (Tratado de Alcanizes in Portuguese) was made in Alcañices between King Dinis of Portugal and King Fernando IV of Castile.
Denis was the grandson of king Alfonso X of Castile and essentially an administrator and not a warrior king. He went to war with the kingdom of Castile in 1295, relinquishing the villages of Serpa and Moura, but gained Olivença and reaffirmed Portugal’s possession of the Algarve and defined the modern borders between the two Iberian countries. The treaty also established an alliance of friendship and mutual defense, leading to a peace of 40 years between the two nations.
King Fernando IV of Castile then married King Dinis of Portugal's daughter, Infanta Constance of Portugal, making her Queen of Castile.