Governor Janet Mills of Maine on Friday vetoed legislation that would have blocked new data centers in the state until November 2027. The moratorium would have made Maine the first state in the nation to create such a hurdle for the booming artificial intelligence industry.

Ms. Mills, a Democrat who is running for U.S. Senate, said in a statement that while she believed a moratorium was appropriate, given the negative effects of data centers elsewhere in the country, she could not endorse the measure because it did not include an exemption she had requested for a long-planned project in Jay, Maine.

The data center in Jay is planned for the site of a vacant mill, whose closure in 2023 “dealt a devastating blow to the town of Jay and its surrounding area,” Ms. Mills said in a statement on Friday. Noting that she had long lived in the area, she added, “I know well how critical the mill was to generations of working families.”

The governor said she intends to establish a council to examine the impact of data centers in Maine; the failed legislation had called for something similar.

“I believe it necessary and important to examine and plan for the potential impacts of large-scale data centers in Maine,” Ms. Mills wrote. “Given the serious conversations about data centers here and around the country, I believe this work should commence without delay.”

Gov. Mills also announced Friday that she had signed legislation prohibiting data center projects from participating in certain state tax incentive programs.

The failed attempt to halt data center approvals in Maine came at a time of growing state and local resistance to the A.I. industry. At least a half dozen state legislatures, including in New York, Minnesota and Michigan, have recently considered similar moratoriums, while public opinion polls show widespread concern about A.I.

Melanie Sachs, a Democratic state representative from Freeport who sponsored the legislation,said the bill had drawn strong bipartisan support, including from residents concerned about possible threats to the environment and higher home energy costs. The centers use a lot of electricity, as well as water to prevent their computer servers from overheating.

Ms. Sachs said in a statement that Ms. Mills was resisting the will of a majority of Maine people. She added, “While a veto might protect the proposed data center project in Jay, it poses significant potential consequences for all ratepayers, our electric grid, our environment, and our shared energy future.”

President Trump has threatened to sue states that stand in the way of A.I.’s growth by enforcing “cumbersome regulation” on data centers.

In Maine, legislators who proposed the moratorium had said its main purpose was to allow time for studying the impacts of data centers on communities, and to draft rules to minimize harmful effects.

The bill had called for a diverse group of interested parties, including environmental experts, utility company leaders and tribal representatives, to study the impacts of data centers and recommend legislative guardrails before the moratorium ended in November 2027.

Some Republican legislators had questioned why existing regulations would not suffice to protect the public.

“What other industry is told they cannot create jobs and support the local economy?” Katrina Smith, the assistant minority leader in the Maine House of Representatives, wrote in an email after the legislation’s passage.

Ms. Mills, a moderate Democrat who is in a tough Senate primary race against Graham Platner, an oyster farmer turned populist star, had previously indicated general support for a moratorium but sensitivity to the plight of Jay, a town of 4,680 people that has been hard hit by the shutdown of the paper mill, its largest employer.

Nicholas F. Jacobs, an associate professor of government at Colby College in Maine, said the veto did not seem likely to help Ms. Mills in her primary battle.

“To the Democratic primary base, who see an obvious need for a moratorium, this is nonsensical,” he said.

The mill in Jay had been severely damaged by an explosion in 2020. A plan to repurpose the site for a board manufacturing business failed when new tariffs set by the Trump administration drove up the cost of needed equipment.

Commissioners in Franklin County, home to Jay, complained in a letter to Ms. Mills that the data center proposed for the town had been “swept up in the hysteria” around other A.I. projects, even though it would have tapped existing infrastructure at the vacant mill. The letter, written April 15, asked her to veto the legislation.

“The Jay project holds none of the negative attributes of the large projects causing problems elsewhere in the country as it simply ‘plugs in’ to the already existing paper mill infrastructure,” they wrote. “We need this investment, we need these jobs, we need these tax revenues.”