Juan Valera y Alcalá-Galiano (18 October 1824 - 18 April 1905), was a Spanish realist author, diplomat, and politician.
He was born at Cabra, in the province of Córdoba, and was educated at Málaga and at the University of Granada, where he took his degree in law, and then entered upon a diplomatic career (1847). Over the next five decades, Valera filled a number of positions in a variety of places. He accompanied the Spanish Ambassador to Naples. Afterwards, he was a member of the Spanish legations at Lisbon (1850), Rio de Janeiro (1851-53), Dresden and St. Petersburg (1854-57). He wrote about the latter mission in Cartas desde Rusia, poking "gentle fun" at his fellow diplomat, Mauricio Álvarez de las Asturias Bohorques y Guiráldez, the third Duke of Gor. After his return to Madrid, he became one of the editors of the liberal journal El Contemporáneo (1859), and was appointed Minister to Frankfurt (1865). After the revolution of 1868 he was appointed Assistant Secretary of State and (1871) Director of Public Instruction. During the reign of Alphonso XII he was Minister to Lisbon (1881-83), Washington (1883-86), and Brussels (1886-88), and in 1893-95 Ambassador to Vienna. He was elected to the Academy of Moral and Political Sciences in 1900.
Throughout his diplomatic and political activity he produced works which rank among the highest that his country's literature contains. For purity of diction and beauty of style Valera has never been surpassed in Spain. Pepita Jiménez, which appeared as a serial in 1874, is probably his best known work; it has since been translated into many languages. It depicts the gradual realization by a young seminarian of the empty vanity of his vocation, culminating in a shattering denouement. Other novels are Las ilusions del doctor Faustino (1875), El comendador Mendoza (1877), Pasarse de listo, and Doña Luz (1879). All of the foregoing novels were written around the time when he abandoned his political activities. He was also a supporter of Iberian Federalism.