Juan de Mella was born in Zamora, Spain, the son of a nobleman, Fernando de Mella, notary of the episcopal curia and escribano de número of Zamora, and of his wife, Catalina de Alfonso. His brother Alfonso de Mella, O.Min., was a member of the Fraticelli. In 1417, Juan began his studies at the Colegio Mayor de San Bartolomé at the University of Salamanca. There, he studied theology and canon law, becoming Baccalarius in decretis in 1412. He then obtained a doctorate in canon law, though the date of the degree is unknown. His tomb inscription appears to indicate that he was Doctor in utroque iure. After obtaining his doctorate, Juan de Mella became a professor of canon law at the University of Salamanca. He was made Dean of Coria by 1421. He was also a prebendary and a member of the cathedral chapter of the Cathedral of Toledo.
During the pontificate of Pope Martin V, he traveled to Rome as Procurator of King John II to defend Archbishop Diego de Anaya before the papal court. Anaya had been excessively loyal to Benedict XIII and was in danger of being deposed. Anaya had also been the founder of the College of St. Bartholomew, of which Mella had been a member. Mella then remained in Rome throughout the papacy of Pope Eugene IV. The Kingdom of Castile, where Mella originated, remained loyal to Eugene, while the Crown of Aragon supported Antipope Felix V. Mella was one of the prelates who represented Pope Eugene as an envoy to and substitute president of the Council of Basel in 1432. He also delivered an oration to the council of behalf of the pope. At the end of 1432, Pope Eugene appointed Mella Auditor of the Roman Rota; he took his oath of office on 23 January 1433. He continued to exercise the function for forty years. The Pope also named him Archdeacon of Madrid. Mella also served as regent of the Apostolic Penitentiary.
Bishop
On April 12, 1434, the cathedral chapter of the León Cathedral elected Mella Bishop of León, to replace Bishop Alfonso de Cusanca who had been transferred to the see of Osma. Bishop Cusanca, however, declined his transfer, leading to Juan de Mella being renamed Bishop of León on August 26, 1437. Throughout this period, however, he continued to reside in Rome. In 1440 Jean de Mella became bishop of Zamora, a position he held until 1465. Bishop Mella participated in the Council of Florence. He was a member of the commission that drafted the papal bullLaetentur Caeli, which attempted to reunite the Latin Church and the Greek Church. This bull resulted in the announcement of reunification at Florence Cathedral on July 6, 1439. Bishop-Elect de Mella signed the final decrees on 6 July 1439: Ego Ioannes de Mella confirmatus Legionen. subscripsi. Mella was transferred to the see of Zamora on April 6, 1440, while his brother Fernando became auxiliary bishop and vicar general of León in his place. In Zamora Cathedral Mella endowed the chapel of San Ildefonso with five chaplaincies and an altar by Fernando Gallego. In 1455, Bishop de Mella was in Wrocław, where he conducted a court case involving the Grand Master of the Teutonic Knights and his subjects, and found for the former. He and the Bishop of Wrocław received a letter from Pope Calixtus III ratifying their decision.