Don Pero (or Pedro) López de Ayala (1332–1407) was a Castilian statesman, historian, poet, chronicler, chancellor, and courtier.
Pero López de Ayala was born in 1332 at Vitoria, the son of Fernán Pérez de Ayala and Elvira de Cevallos. He was nephew to Cardinal Pedro Gómez Barroso, and was educated under this cleric. López de Ayala was a supporter of Pedro of Castile before switching sides in order to support the pretender to the Castilian throne, Henry of Trastamara. The Ayala were one of the major aristocratic families of Castile. The earliest known record of their family origin was an account written by Pero's own father which claims they derived from Pyrenees Christian royalty and linked them to the Lords of Biscay. Later, Catholic bishop Lope de Barrientos (1395-1469), trying to dampen anti-semitic persecution, would claim that most of the nobility of Castile themselves had Jewish origins and that the Mendozas and Ayalas descended from a certain Rabbi Solomon and his son Isaque de Valladolid.
As Alférez mayor del Pendón de la Banda (second lieutenant), he fought with Henry at the Battle of Nájera (1367) and was made a prisoner of the Black Prince but was later released. In 1378, he traveled to France in order to negotiate an alliance against the English and Portuguese.
He subsequently served as a supporter of John I of Castile. He was captured by the Portuguese at the Battle of Aljubarrota (1385), and was jailed in a prison of iron. From his Portuguese prison, he wrote his Libro de la caza de las aves ("Book on hunting with birds of prey") and parts of his Rimado de Palacio. He was ransomed for 30,000 doubloons after many had interceded on his behalf, including his wife, Doña Leonor de Guzmán, the Master of Calatrava, and the kings of both Castile and France.