A soldier helping police quell violence against foreigners in South Africa shot and killed a man who was attacking a woman, the military said Saturday, as hundreds more immigrants fled the country. Police also fired rubber bullets to disperse crowds as sporadic violence and looting were reported across the country in the latest disturbances, which have left at least 42 people dead and more than 25,000 foreigners displaced this month. Much of the violence is fueled by resentment of immigrants competing for scarce jobs and housing. Others blame foreigners for crime. Seeking to calm the unrest, President Thabo Mbeki called in the army on Wednesday for the first time since the end of apartheid in 1994 to aid police. Mbeki condemned the violence, saying during an appearance at a school in eastern South Africa that it disgraced the legacy of the liberation struggle, the state broadcaster reported Saturday.