President Barack Obama on Friday vetoed a bill that would allow families of the victims of terrorist attacks in the United States to sue foreign governments believed to be linked to the strikes, setting up a difficult election-year decision for congressional Democrats.

Obama expressed “deep sympathy” for those who lost loved ones on Sept. 11, 2001, writing in a statement accompanying the veto that he has “deep appreciation of these families’ desire to pursue justice and [is] strongly committed to assisting them in their efforts.”

GOP presidential nominee Donald Trump called the veto “shameful,” and said he would have signed it into law. Earlier in the day, Democratic nominee Hillary Clinton broke with Obama and said she would have signed it.

Obama cited concerns that the legislation, which passed both the House and Senate with overwhelming bipartisan support, could prompt other nations to pass look-alike laws, leading to more lawsuits and inconsistent standards for what constitutes state support for terrorist attacks. Proponents, however, call it “narrowly” crafted to guard against such things.

He wrote that he could not sign the measure into law because it “would neither protect Americans from terrorist attacks nor improve the effectiveness of our response to such attacks.” Instead, Obama concluded, as crafted it would allow cases to be brought to U.S. courts against other countries based solely on allegations, not longstanding methods of determining state sponsors of terror.