Massachusetts officials are struggling to understand why the state has been blacklisted by San Francisco over the state's abortion laws.

Last month, San Francisco officials announced a ban on travel by city employees to Massachusetts and 21 other states whose abortion laws were deemed too restrictive by the San Francisco Board of Supervisors. The ban starts Jan. 1, 2020. San Francisco will not allow city contracts with Massachusetts-based companies after that date either.

“At a time when reproductive rights are being attacked from Washington and state houses across the country, it is imperative that San Francisco step up and fight back,” San Francisco Supervisor Vallie Brown, who filed the ordinance, said in a statement.

San Francisco Mayor London Breed's office says all the banned states “restrict abortion before viability of the fetus to live outside of the womb.” Massachusetts allows abortions up to 24 weeks. After that, abortions are only allowed in cases where the woman’s life or health is at risk.

Elizabeth Nash, senior state issues manager with the Guttmacher Institute, an abortion rights research group, says she can see how Massachusetts ended up in the banned category, but, "it does seem a little incongruous to have Massachusetts on that list.”

Massachusetts, Nash says, “has been supportive of abortion rights and supportive of a strong safety net to ensure that people have access to the health care that they need.”

State Senator Harriette Chandler is sponsoring legislation that would extend abortion rights to women in their third trimester if the fetus is diagnosed with a fatal condition. The San Francisco Department on the Status of Women, which compiled the list of banned states, says passage of that bill might get Massachusetts off the list, but there's no guarantee. Chandler says Massachusetts won’t be swayed.

“Massachusetts has been a leader on abortion rights, and we don’t legislate based on other cities’ critiques,” Chandler said in a statement.

The blacklist is triggering a wide range of reactions, from business leaders who mutter about crazy times in San Francisco, to this from Andrew Beckwith, president of the Massachusetts Family Institute, a group that opposes abortion rights.

“Massachusetts already loses over 18,000 of its unborn children every year to abortion," he said. "How many more will it take to satisfy the mayor of San Francisco?"

The San Francisco Administrator’s Office says it can’t estimate how many Massachusetts-based firms might not be eligible for city contracts after Jan. 1, because it doesn’t track payments based on a company’s headquarters. It’s not clear if the city has denied any employee requests to travel to Massachusetts. San Francisco officials say they hope other municipalities and states will join the ban.

Nash, with the Guttmacher Institute, says she doesn’t know of any other similar measures, but she says an increasing number of municipalities are taking steps to outlaw abortion, while others are moving to protect access to abortion.

“We’ve seen localities really step into this in a new way,” Nash said.

Leaders of two abortion rights groups in Massachusetts declined requests for comment on the San Francisco ban, as did three business group leaders and Governor Charlie Baker.