Anayah Williams was barely 3 months old when she suffered skull and rib fractures and Child Protective Services removed her from her home.

After 18 months in a Frederick County foster home, Anayah was returned to her family.

And three weeks after that, she was dead, allegedly beaten by her father.

A bill that gives authorities more power to keep children out of potentially dangerous homes is making its way through the Maryland General Assembly. Child welfare advocates and several lawmakers say the measure could have prevented Anayah’s death last year.

On Thursday, the House approved the bill, known as Anayah’s Law, by a vote of 135 to 2. The Senate version of the bill passed earlier this year.

Del. Kathryn L. Afzali said Anayah’s life would have been different under the measure, which she sponsored.

“The law just didn’t protect her,” said Afzali (R-Frederick). “The [bill] as it is written now would have saved Anayah. . . . And I sincerely believe it will save others.”

Deborah Ramelmeier, the acting executive director of social services with the Maryland Department of Human Resources, said the legislation expands the instances in which social workers would not be required to try to reunite parent and child.

Current law says that “reasonable efforts” have to be made unless the parent has committed chronic abuse, chronic and life-threatening neglect, sexual abuse or torture against the child; has involuntarily lost parental rights of a sibling of a child; or has been convicted of a crime against a child or helped commit a crime against a child.

Ramelmeier described the law as “one of the strictest in the country.” She said Afzali’s bill closes a loophole in Maryland law, putting it in line with others across the nation.

The bill adds “severe physical abuse” to the reasons why a social worker could receive permission from the courts to keep a child out of his or her home. It also includes abandonment of a child and specifies that a parent cannot have abused or tortured a sibling of the child or another child in the home.

Afzali said Anayah was returned to her parents, Frankie A. and Stephanie E. Williams, despite concerns from doctors and social workers that she had been severely abused in their care.

There wasn’t enough evidence to charge either parent, and social workers did everything they could under the law, Afzali said.

She said there was no evidence that Anayah suffered “chronic” abuse, a requirement under the old law to receive a waiver from reunification. But under the new measure, because she suffered “extreme abuse” in 2012, social workers would not have been forced to send her back to her family, Afzali said.

Ramelmeier said the state rarely requests waivers to keep a child from his or her parents. She said there have been 23 requests in the past three years.

“These are our most horrific cases, and we don’t see them that often,” she said. “But when we do see them, we need to have the ability to take the steps to ensure that these children are safe.”

Del. Jill P. Carter, who voted against the bill, said she worries that the measure is too broad, providing little exception for young parents who might turn their lives around.

“I’m not certain that this would fix what people see as the problem,” said Carter (D-Baltimore), a lawyer who has worked for the city’s public defender’s office.