At the end of the 20th century there was an emerging consensus among developmental neurobiologists that the establishment of thalamocortical connections (at about 26 weeks) is a critical event with regard to fetal perception of pain.
Developmental neurologists mostly believe fetal pain begins around 26 weeks. This theory comes from the establishment of thalamocortical connections. These allow the brain to perceive pain.