During the 15th century, Leonel de Lima was a prominent noble deeply involved in political and jurisdictional struggles in northern Portugal. His influence was closely tied to the region of
Entre Douro e Minho, where he both asserted his family's rights and clashed repeatedly with local authorities. Points of contention with the town of Ponte de Lima included residence rights and jurisdiction over the land of São Martinho. Although the Crown had granted São Martinho to Leonel's father in 1399, the town of Ponte de Lima never fully accepted the Lima family's authority in the area. In 1441, the town brought formal complaints against Leonel before the royal court, claiming that his family had never lawfully exercised coudel jurisdiction there. The dispute persisted into the 1470s, with the town invoking earlier royal rulings to reinforce its position. In the late 1430s, Leonel established a residence within the walls of Ponte de Lima. His presence was perceived by the town as a direct challenge to municipal autonomy. In 1462, following renewed complaints,
King Afonso V ordered regional nobles to present documentation proving their jurisdictional rights and reaffirmed earlier grants made to the Lima family, likely at Leonel's request. That same year, a now-lost court decision upheld Leonel's right to reside in the town. In response, the townspeople secured a royal grace document on 18 August 1462, guaranteeing the preservation of Ponte de Lima's privileges after Leonel's death. Meanwhile, in September 1461, Leonel transferred the revenues, tolls, and jurisdictional rights over Ponte de Lima to his eldest son, João de Lima, to take effect in January 1462. This act ensured the continuity of family control over the town despite the opposition they faced. In 1464, Leonel was appointed alcaide (castle governor) of Ponte de Lima and received royal authorization to erect a castle, which became the . In 1478, Leonel was granted the town of
Vila Nova de Cerveira and elevated to the title of viscount by King Afonso V, becoming the first person to hold a noble title of viscount in Portugal. In 1480, he petitioned the Crown to bar his younger sons from residing in Ponte de Lima or in his lands, restricting them to occasional visits at his discretion. == Legacy ==