At the beginning of the Civil War, approximately 10 percent of African Americans were free. But as much as one-quarter of the free population were runaway slaves who had to live with a daily fear of being recaptured and returned to slavery, almost certainly with exemplary punishment. Their situation was perilous in both northern and southern states and worsened as tensions about slavery increased. Although slavery had ended in most northern states by 1840, rising tides of prejudice and the arrival of new groups of European immigrants pushed African Americans out of many trades. One sector that remained open to them was food service, whether in private homes or as independent caterers, street merchants, or cooks and waiters in commercial hotels and restaurants.