Many researchers believe it occurs even earlier than that - at least as early as the completion of organogenesis when the peripheral and central nervous systems have formed (about 9 weeks). The fetus at that point has been observed to react to painful stimuli.