Saudi authorities have released an Iranian Hajj pilgrim 20 days after arresting him in the city of Medina.