The legislation would have made it illegal for any person to perform or attempt an abortion after 20 weeks of pregnancy, with the possible penalty of five years in prison, fines or both. A woman seeking an abortion would not be penalized.

About 20 states already have similar bans. Republicans and anti-abortion activists argue the bill is necessary because advances in science and medicine make it possible for babies born prematurely to survive earlier than in previous years.

A study published in The New England Journal of Medicine in 2015 found that a small minority of babies born at 22 weeks were able to survive with few health problems.

“We’re trying to proceed to make sure that America will be a better place, that we become part of the mainstream of the world when it comes to protecting unborn children in the fifth month of pregnancy,” Graham said.

"It is disappointing that despite support from a bipartisan majority of U.S. Senators, this bill was blocked from further consideration," Trump said in a statement following Monday's vote. "The vote by the Senate rejects scientific fact and puts the United States out of the mainstream in the family of nations, in which only 7 out of 198 nations, including China and North Korea, allow elective abortions after 20 weeks of pregnancy. We must defend those who cannot defend themselves. I urge the Senate to reconsider its decision and pass legislation that will celebrate, cherish, and protect life."

Democrats and abortion rights activists, however, argue abortions after 20 weeks are rare and such bans would infringe on a woman's right to make her own health care decisions.

Democrats also criticized Republicans for holding a vote on a bill that won’t pass instead of focusing on more pressing issues, like reaching a spending deal by Feb. 8, when the government will run out of money.

While the bill failed to pass Monday, anti-abortion groups plan to use it to hit vulnerable Democrats up for reelection in 2018.