DES MOINES, Iowa — Iowa Gov. Kim Reynolds vetoed a measure Wednesday intended to stop the state's Democratic attorney general from filing or joining lawsuits challenging President Donald Trump's policies, but she did so only after gaining an assurance the state's participation in such actions would end.

Reynolds had been under pressure from current and former attorneys general around the country to reject the provision that Republicans pushed through in the final days of the legislative session out of exasperation that Attorney General Tom Miller had joined lawsuits that aligned the state against Trump administration policies. If signed into law, Iowa would have been the only state with such limits.

Although Reynolds vetoed sections of a justice system budget bill that included the limits on the attorney general's authority, Miller acknowledged he had reached an agreement with the governor before she took action. Under that deal, Miller would get the governor's consent before bringing out-of-state cases in which the state of Iowa is the plaintiff.

"This means that generally I will not be suing the Trump administration," Miller said in a statement.

Miller, who was first elected attorney general in 1978 and is the nation's longest-serving attorney general, said he made the promise to Reynolds to ensure that those who hold his office in the future will retain all its powers.

"A long time ago when I was first elected Attorney General of Iowa, my elders — the other state Attorneys General — preached to me the importance of the powers and duties of our office and the great obligation to protect those powers and duties," Miller said. "I will not be haunted by the ghosts of my elders."

Under the provisions approved by legislators, the attorney general would have been required to get the permission from the governor, Legislature or state executive council before filing any out-of-state court action. The executive council is comprised of the governor, auditor, treasurer and secretaries of state and agriculture — Republicans now hold three of those five positions.

Republican Rep. Gary Worthan sponsored the measure, saying Miller had sued the Trump administration too often and was out of step with the state.

"We have a Republican governor, we have a Republican Legislature, and we have had an attorney general that has been going outside of the state taking part in lawsuits that are the complete antithesis to the agenda that the governor and the Legislature has set," Worthan said.

In a statement announcing her veto, Reynolds expressed concerns about Miller's decision to join lawsuits she said didn't reflect the "policy goals of the Legislature and governor."

However, Reynolds said she worried about reducing the attorney general's power.

"I am cautious about approving a provision that redefines the scope of the Attorney General's duties because I am mindful that the Attorney General is also elected by, and directly accountable to, the people of Iowa," she said.

Even as he reached a deal with the governor, Miller defended his decision to join multi-state lawsuits challenging the Trump administration, saying he did so only when the suits were well-grounded in law. He argued that polls show Iowans agreed with his efforts, such as lawsuits dealing with immigrants who entered the country illegally as children and separation of children from their immigrant parents.

"I am reassured by the fact that the cases will continue to be brought by my 26 Democratic Attorney General colleagues, and they will do a very effective job," Miller said.