Surprisingly, one of the best articles that I have ever read concerning the topic of fetal pain is found here in the New York Times. It is certainly long, but well worth the read if you are at all interested in the topic.
As for my view - and considering my career I may be considered well versed on the topic, it may surprise some. The answer to the question of does a fetus feel pain is... I don't know. And neither does anyone else. Pain is a subjective experience that does not always even need a stimulus for someone to experience. My patients under sedation can have an elevated blood pressure despite the fact that I know they are not experiencing pain. At the same time, a patient can have the sensation of pain without any reason. Pain is very complicated, and because none of us is able to remember our fetal experiences - we cannot for certain state that a fetus has the ability to feel pain. This in important to understand whenever anyone on either side claims they know the truth to this question. It also needs to be appreciated that our understanding and treatment of pain has changed greatly in recent years and it is a topic we continue to learn more about.
Yet, we can look at objective truths in order to attempt to determine the chance that a fetus can feel pain. These facts are not in dispute, and many of them are confirmed in the article above:
1. Doctors have historically underestimated the ability of young humans to feel pain. This is true from circumcision to pediatric dentistry, in which many patients still remember having their dentist hurting them because we thought primary teeth had less developed nerve supply and thus wouldn't be painful when drilled into.
2. In NICUs, humans as young as 21-22 weeks gestation withdraw and cry when poked with a needle. I have seen this personally in a 28 week gestation child, and it sure as heck looks like the kid is reacting in pain.
3. During fetal surgery, the fetus in utero withdraws from the surgeon's scalpel. This has caused a change in how we perform anesthesia as well as the use of local anesthesia for the wound during surgical interventions.
4. A human fetus in utero shows a hormonal response that is similar to the hormonal response that infants show when they are in pain. This hormonal response causes a significant change in the vital signs and evidence shows that a human which experiences this hormonal change may have detrimental effects from it in the future.
5. Controlling pain via local or general anesthesia decreases the above hormonal response in both human beings outside of the womb and those inside of the womb.
6. Born human beings that do not possess a cerebral cortex seem to be able to feel pain.
In conclusion, can we say with certainty that a fetus can feel pain? No. Neither can anyone state that they know that a fetus cannot feel pain. However, considering the evidence above, and considering our past errors in the past, we should assume and treat accordingly every human organism that we subject to a painful surgical stimuli as if they can feel pain. Those who state otherwise bear the burden of proof to show why we should not.