Five months after President Donald Trump claimed thousands of people were bused to New Hampshire to vote illegally on Election Day, the state’s governor signed a law tightening residency requirements for voters in the state.

New Hampshire election officials said they had no evidence that Trump’s allegation was true, and the president has offered no evidence to support it. But voting advocates say the claim nonetheless weakened confidence in the state’s election system and provided fuel for officials to pass the measure.

New Hampshire provides a case study for how Trump’s unsubstantiated claims about voter fraud can lay the groundwork for restrictive voting laws. It’s a phenomenon that has taken on increased significance since Trump convened a federal probe to look into voter fraud to try and prove that as many as 5 million people voted illegally last year.

Under the New Hampshire measure, people who move to the state within 30 days of an election must now show proof they intend to make the state their permanent domicile. According to the law, a person can only vote in New Hampshire if it is “the place in which the person resides his or her one place, more than any other, from which he or she engages in the domestic, social, and civil activities of participating in democratic self-government including voting, and has acted to carry out that intent.”

If a would-be voter fails to produce acceptable proof of that, the law authorizes local election officials to send “2 or more municipal officers or their agents” to the person’s address to verify residency.

Critics say the measure imposes a needless restriction because there’s no indication that massive amounts of people are voting illegally. The new law, they say, will simply discourage people from voting.

Trump wasn’t the first person to stoke fears about out-of-state voters casting ballots in New Hampshire. Gov. Chris Sununu (R) said in November that people were being bused in to vote in New Hampshire, but offered no evidence.

Taken together, the comments created a perception that New Hampshire elections were ripe for fraud ― an impression lawmakers exploited as they pushed for the need to tighten residency requirements, critics say.

“Many of the bill’s proponents – fueled by President Trump’s post-election remarks and Governor Chris Sununu’s pre-election comments – have embraced the allegation that there is rampant voter fraud in New Hampshire. This allegation is false,” Gilles Bissonnette, the legal director of the New Hampshire chapter of the American Civil Liberties Union, wrote in an email.

As state lawmakers considered the bill, they focused on the perception of voter fraud, said Wyatt Ronan, a spokesman for the New Hampshire Democratic Party.

“The basis for the argument on [the new law] seems not to be any credible voter fraud because there hasn’t been any measured in the state,” Ronan told HuffPost.

“I think the legislators’ argument for passing this voter suppression bill was that people were concerned about what they felt was a lack of integrity in the elections. Not that there was any actual problem there,” he added.

This is xenophobia that is developed by perpetuating some of these myths." Wyatt Ronan, spokesman for the New Hampshire Democratic Party

During legislative hearings, New Hampshire lawmakers used anecdotal evidence, like the kind Trump pushed, to argue in favor of the bill, Ronan said.

“There would be a couple of testimonies in these hearings where they would say ‘Well I saw somebody park around a corner and come in to the voting booth,’” he explained. “They used that as evidence that this person wasn’t from here. This is xenophobia that is developed by perpetuating some of these myths. People start to take these conspiracy theories and turn them into reality.”

Both Bissonnette and Ronan pointed to testimony from state Rep. Al Baldasaro (R), who was a Trump adviser during the campaign and came under fire during the presidential campaign for saying Trump’s opponent Hillary Clinton should be killed. Testifying about the pending legislation, Baldasaro said he counted 27 people with Massachusetts license places getting out of their cars to vote in a 90-minute span last year.

State Rep. Fred Doucette (R), who was a Trump campaign co-chair in New Hampshire, told NH1 News he had also personally seen people getting out of cars with Massachusetts plates to vote.

Paula Hodges, the New Hampshire state director of America Votes, said many Republicans who were quick to speak out against Trump’s claims of busing declined to speak out against the bill.

New Hampshire Secretary of State Bill Gardner (D) said there’s no evidence of widespread voter fraud, but supported the new residency requirements as a way of shoring up confidence in the state’s elections.

Clinton defeated Trump by 2,732 votes in New Hampshire last year.

Correction: An earlier version of this story incorrectly described the election outcome in New Hampshire last year.