(CNN) -- A bill that would keep sealed some photos and documents from the Sandy Hook Elementary School shooting investigation passed overwhelmingly in the Connecticut legislature early Wednesday.
The new legislation blocks public disclosure of any visual images depicting those who died in the shooting on grounds that release of the images would "constitute an unwarranted invasion of the personal privacy of the victim or the victim's surviving family members," according to the bill.
The bill passed in the state Senate just after 1:30 a.m., with 33 senators voting in favor of the bill and two voting against. It passed in the state House at 2 a.m. on a vote of 130 in favor, and two against. Lawmakers were working late hours to clear legislation before scheduled adjournment this week.
The bill would prevent any graphic visual evidence of slain individuals from being released even through Freedom of Information Act (FOIA) filings.
Gov. Dannel P. Malloy supports the measure and is expected to sign it later this week, said deputy press secretary David Bednarz.
All 911 recordings will still be publicly available, as well as audio recordings of first-responders, fire fighters and police. However, any audio recordings with graphic descriptions of a victims' bodies will be redacted.
A task force will also be established to "consider and make recommendations regarding the balance between victim privacy under the Freedom of Information Act and the public's right to know," the bill says.
An earlier draft of the bill limited the new legislation specifically to the Newtown case. However, the final draft passed Wednesday was expanded to include all homicide victims in Connecticut.
"My goal with this legislation was to provide some measure of protection for the families affected by the tragedy at Sandy Hook Elementary School. But the fact is, all families have a right to grieve in private. Those who lose loved ones to violence have a right to protect themselves against further anguish," Malloy said in a statement.
State Senate Minority Leader John McKinney represents the Newtown area and was a chief proponent of the bill. He commended the families of Newtown victims for speaking out in support of the measure.
"The families have shown tremendous courage in coming to the Capitol and publicly asking the legislature to protect their privacy rights with respect to the graphic evidence and crime scene photographs of their murdered children and loved ones," said McKinney, a Republican.
The new law drew concern from others who feared the bill would limit freedom of information and hamper future investigations.
State Sen. Ed Meyer, one of two senators who voted against the bill, noted that the Newtown crimes were committed on public property and the photos and recordings were taken by public officers.
"The suppression of horrific crimes committed on public property and recorded by public officials is not consistent with a free and open society," Meyer, a Democrat, wrote in a statement.
Meyer, a father of six and grandfather of 13, said he identifies greatly with the sadness that Newtown families feel, but believes that withholding certain pieces of evidence from the public will have long-term negative effects.
"The more we understand about our ugliness, the better chance we have to overcome that ugliness. Suppression of horrific conduct, as this bill dictates, invites history to repeat itself," Meyer said.
McKinney noted that while he has been a strong advocate of freedom-of-information laws, he was "unapologetic" about supporting the efforts of Newtown families to keep gruesome photos and details from public view.
The final bill required extensive compromise from both, requiring all members of Connecticut's General Assembly "to balance deeply held beliefs and important public policy values," the governor said.
Malloy commended the legislators "on coming to an agreement that respects the privacy of grieving families."
All future FOIA requests will go through the Freedom of Information Commission in Connecticut. Commission members will now have to weigh whether to publicly disclose images based on this new law, said Brett R. Cody, spokesman for McKinney.
Requests for evidence will continue to be considered carefully, but "when privacy rights of victims and their families outweigh freedom of information, those privacy rights will be protected," said Cody.
The passage of the bill comes just under seven months after a lone gunman opened fire at Sandy Hook Elementary School in Newtown. After fatally shooting his mother at home, Adam Lanza killed 20 children and six educators before taking his own life.