BOSTON - Phoebe Prince and Carl J. Walker-Hoover were not at the State House for the signing of an anti-bullying law Monday, but the spirits of the two deceased students were in the air on a landmark day in the battle to protect young people in school.

Walker-Hoover, 11, a student at New Leadership Charter School in Springfield, hanged himself in April of 2009 after being bullied in school. Prince, 15, a freshman at South Hadley High School, hanged herself on Jan. 14 following what investigators said was three months of harassment and bullying by fellow strudents.

The Northwestern District Attorney’s Office has filed charges against six students in connection with Prince’s suicide. The alleged offenses range from criminal harassment to stalking to statutory rape.

Gov. Deval L. Patrick struck a blow for Hoover-Walker, Prince and all other students who face bullying in school when he signed into law a bill that bans it on all school grounds, buses and activities, and mandates that every instance of bullying be investigated by school officials and reported to the parents of the students involved.

Speaking both as a governor and a parent, Patrick said he was proud of the new law.

“We are giving our teachers, parents and kids the tools and protections they need so that every student has a chance to reach their full potential,” he said.

Sideaner Walker, Walker-Hoover’s mother, was among 10 family members present for the signing in Boston. She met privately before the event with the governor, who told her he admired her strength and courage in pursuing social change in the wake of her son’s death. Walker said she hopes the new law will make life easier for students in the future.

“By passing the law, it will assist schools,” she said. “They will have to report incidents (of bullying).”

Walker is hopful that the law, which is tough in cyber bullying, will help protect young people being harassed on social networking sites.

“Our kids are faced with obstacles we weren’t faced with when we were kids,” she said.

Although Massachusetts is among the last states to pass such a bill, state Rep. John W. Scibak, D-South Hadley, believes it will become the gold standard for anti-bullying measures.

“It’s probably the most comprehensive bill in the country,” he said.

Scibak, who is on the cyber-bullying subgroup of South Hadley’s Anti-Bullying Task Force, said the town’s efforts are already in line with what the state has mandated.

“It’s very similar to what we put in the legislation,” he said. “It validates what the Task Force has been working on.”

Many in South Hadley feel that the negative publicity resulting from Prince’s suicide has painted the town in an unfairly bad light. Scibak noted that the new law requires school systems to post their anti-bullying plans on their communties’ Web sites, which will allow parents to compare them.

“(The law) provides a framework and structure for all schools to deal with bullying,” he said. “Some will clearly have to change their policies and practices.”

State Sen. Michael R. Knapik, D-Westfield, was a member of the conference committee that worked on the bill. He is hoping it will lead to a cutural shift both in how schoool officials handle bullying and in student behavior.

The legislation also set up a task force of law enforcement officials who will consider additional legal sanctions for bullying, according to Knapik. He said the state might have to revisit the legislation as the climate surrounding bullying evolves.