Samuel ben Meir Ha-Levi Abulafia, was the treasurer of king Pedro I "the Cruel" of Castile and founder of the Synagogue of El Transito in Toledo, Spain. Born to the Abu-l-Afiyat family of Tunisian Jewish origins his parents died of plague shortly after arriving in Toledo. First he worked as administrator to the Portuguese knight Juan Alfonso de Alburquerque and became recognized enough to achieve employment at the court of Pedro I of Castile, first as camarero mayor and later as almojarife and as oídor. His employment ended when the enemies of Pedro I led by Henry of Trastámara organized a pogrom against the Toledan Jewry, which enabled them to assume possession of the royal treasures. The king marched to Toro to demand the return of his belongings, and Samuel Ha-Levi accompanied him, and later supported the King in reclaiming Toledo for the crown, and in the establishment of a peace treaty with the Portuguese at Évora in 1358. In Toledo he lived in the palace that is today the Museo de El Greco, and with the considerable riches bestowed upon him by his employer he founded the Synagogue of El Transito between 1355 and 1357. The building was one of ten small synagogues serving Toledo's large Jewish population, and while architecturally exquisite its dimensions are not particularly impressive. Its construction was opposed vociferously by the Catholic church, but King Pedro permitted it. Constantly criticized by his rivals for his permissive stance towards Jews, eventually the King turned against ha-Levi and had him incarcerated and tortured on suspicion of embezzlement in 1360. He died under duress of torture. The prominence of Samuel Ha-Levi at Pedro's court has often been cited as evidence of his supposed pro-Jewish sentiment, but Ha-Levi's success did not necessarily reflect the general experience of the Spanish Jewry in this period which was often marked by discrimination and pogroms. And even Samuel's career shows that the opportunities for Jews were restricted to certain offices and positions whereas other forms of advancement were denied to them.