BP settles with five states, federal government