Forty percent of Massachusetts residents oppose the government obtaining telephone records and electronic information of Americans, according to a new Boston Globe poll, while a quarter of Bay Staters support those efforts.

The survey, conducted a week after disclosure of secret government surveillance programs by contractor Edward Snowden also found that more than a third have not heard enough to form an opinion or are neutral on the issue.

Intelligence officials say the programs, which collect millions of US phone records and a wide swath of Internet communication, are operated lawfully and narrowly under judicial review and are essential to national security.

But privacy advocates and some members of Congress believe the data gathering goes too far. US representatives from Massachusetts have been among the strongest critics of the programs.

Their criticism was reflected in the comments of poll respondent Nelson Read, 43, of Northampton, who said he was angry about what he saw as government overreach.

“To sit there and have the government actively pursuing information on its citizens, it’s not right, not in a republic anyhow,” said Read, an independent. “I think our Fourth Amendment rights should be enough to prevent them doing that,” he said, referring to the portion of the US Constitution that prohibits unreasonable searches and seizures.

But opposition to the government’s gathering of data is, by no means, universal in the state.

A quarter of Massachusetts adults support the broad data-gathering programs, first reported in the Washington Post and the Guardian.

Respondent Ann Rettman, a 33-year-old from Watertown, was one of them and saw “a fine line” between security and privacy.

“Ideally, if they could keep us safe without that level of intrusion into our lives, that would be great,” Rettman said. “But I don’t think that’s realistic.”

The poll of 755 randomly selected Massachusetts adults was taken from June 11 to June 14 and has a margin of error of plus or minus 3.6 percentage points.

The opposition to the data-gathering is similar across racial and gender lines.

“There’s general opposition — it’s not strong opposition, but it’s opposition — and it comes across all demographic groups,” said Andrew E. Smith, director of The Survey Center at the University of New Hampshire, which conducted the poll.

White people and members of minorities support and oppose the data sweeps at similar rates. Forty-three percent of men oppose them, while 38 percent of women do.

Opposition differs somewhat based on political party affiliation: 47 percent of those who are unenrolled oppose the surveillance; 41 percent of registered Republicans oppose it; and 31 percent of registered Democrats oppose it.

Overall, 18 percent of those surveyed are neutral on the issue and 17 percent do not know enough about it to have an opinion.

Those numbers were a sign that a significant portion of residents had not “tuned in” to the debate over the programs, said Smith, the pollster.

Respondent Frederick R. Levy, a 67-year-old Cambridge resident, said he needed more information before coming to a conclusion on the programs.

“I don’t know enough to make such a snap decision,” he said.

Levy explained he had an inherent wariness about government surveillance, but is “skeptically willing to believe that there is a possibility that they are of value.”

Former counterterrorism officials say that, as the public learns more, support for the data-mining operations will grow.

Tom Powers, a former Boston-based FBI agent who worked for years on terrorism issues, said he expected support for the programs to increase as people in Massachusetts and around the country learned more about the programs’ specifics and the safeguards in place to protect privacy.

“I’m convinced a lot of Americans don’t have a lot of the right facts,” said Powers, who supports the programs, calling them a necessary tool.

“It’s one of these things, if it’s local, and you were being threatened, you would want government agents to be able to” have access to data from the programs, Powers said.

Privacy advocates vehemently disagree. Carol Rose, the executive director of the American Civil Liberties Union of Massachusetts, decried the programs, calling them a “huge dragnet that the government has secretly been carrying out against all of us.”

“I think when people realize that the government can look at practically any information about ordinary Americans’ everyday activities,” said Rose, “they’ll be less inclined to support the programs.”

Over the weekend, in an effort to show that the phone-tracking program is relatively narrow in scope, intelligence officials said that fewer than 300 phone numbers were checked against the massive database of millions of telephone records last year, according to the Associated Press.

Earlier, government officials have said the program that collects Internet data is focused on non-Americans and that the phone records program allows them to access only metadata, which contains things such as the phone number called, but not the call itself.