Rafael Anselmo José Yglesias Castro served as President of Costa Rica for two consecutive periods from 1894 to 1902.