The first blacks in Philadelphia were slaves; with at most 1,500 people living as slaves in the city during the period slavery was legal. Slaves in Philadelphia usually lived in the same house of their owners and worked as servants or in their owners' shops. An abolition law in 1780 did not free any existing slaves, but banned the slave trade in Pennsylvania and freed the children of slaves born after the law was passed once they reached a certain age. By the time the law was passed, about 400 slaves and 800 free blacks lived in Philadelphia. Many newly freed slaves and escaped slaves from the South moved to the city, and by 1820 the city's African American population was nearly eleven percent. During this time one former slave, Richard Allen, founded the African Methodist Episcopal Church in Philadelphia. As the African American population grew, so did white hostility towards them. African Americans were attacked and killed in the street and in their houses during a race riot in 1834, and four years later a state law was passed that prevented African Americans from voting. Abolitionists were also targets; they were prevented from spreading their message, and one of their meeting houses was burned.