Virginia Gov. Terry McAuliffe (D) on Friday vetoed a bill passed unanimously by the General Assembly that would have barred him from accepting donations from anyone seeking grants from an economic-development fund he controls.

The multimillion-dollar Governor’s Opportunity Fund provides cash grants and loans to companies that maintain or create jobs in the state. A ban would have blocked contributions or gifts worth more than $50 from applicants, but McAuliffe said more time was needed to avoid compromising applicants’ confidentiality.

Republicans and Democrats immediately criticized the governor’s action.

The ban would have removed even the appearance of wrongdoing, said Del. Scott A. Surovell (D-Fairfax).

“Governor McAuliffe, every governor, has been very invested in using it to try to improve business, and the executive branch never likes to have restrictions based on it,” he said.

Del. James M. LeMunyon (R-Fairfax) said he plans to reintroduce the bill next year.

“I had hoped the Governor would sign this legislation, given its overwhelming support,” he said in a statement.

The bill passed earlier this year in the rush to tighten restrictions on public officials after former governor Robert F. McDonnell and his wife were indicted on charges that they lent the prestige of the governor’s office to a Richmond businessman in exchange for at least $165,000 in gifts and loans.

House Speaker William J. Howell (R-Stafford) called the veto “a disappointing and unfortunate step in the wrong direction,” especially in light of the McDonnell case.

The Governor’s Opportunity Fund has a balance of $35 million.

Although grant seekers’ identities are supposed to be kept secret, tracking the donations for companies going through the application process could have exposed them, said Brian Coy, a spokesman for McAuliffe.

“The legislation that they put together would have raised the very real possibility that it would have compromised the confidentiality of these agreements,” Coy said.

But before killing the bill altogether, McAuliffe suggested also applying the ban to legislators — an accountability measure the General Assembly declined to entertain.

Surovell said the executive branch administers the fund, leaving lawmakers in the dark until the governor announces the grant recipients.

“The idea that we should have been involved somehow in the legislation is nonsense, because we’re not part of the process at all. We’re completely cut out of the process,” he said. “We’d have to be omniscient or have ESP.”

Surovell said he got the idea for the ban a few years ago after the General Assembly put a temporary freeze on contributions and gifts from companies seeking to partner with the state on public projects.