ANNAPOLIS, Md. - Maryland yesterday granted a new safeguard to its most downtrodden residents, becoming the first state in the nation to extend hate-crimes protection to homeless people.

The bill signed by Gov. Martin O'Malley adds homelessness to the protected categories under Maryland's hate-crimes law, which allows prosecutors to seek tougher penalties for those who target people because of race, ethnicity, religion, and sexual orientation.

California, Texas, and Ohio are considering similar bills, and legislation has been introduced in Congress.

Lawmakers pointed to cases like the one in south Baltimore in 2001, where a group of young men embarked on what a judge later described as a "systematic cleansing" of homeless men in their neighborhood. Three victims were beaten to death and others were forced to relocate. Three men went to prison for the crime one of them dubbed "bum stomping."

Such attacks on the homeless are becoming more common, advocates say. More than 800 homeless people have been violently attacked in the United States in the last decade, and at least 217 have died, the National Coalition for the Homeless said. In 2007, there were 160 attacks, the most in a year since the group began collecting such data in 1999.

Brian Levin, director of the Center for the Study of Hate and Extremism at California State University-San Bernardino, said the law extended unprecedented protection to an increasingly vulnerable population. "The homeless are arguably the most victimized class, criminally, of anyone out there," Levin said.

The Maryland bill's sponsor, State Sen. Alex Mooney, is one of the General Assembly's most conservative members and had vociferously opposed adding sexual orientation to Maryland's hate-crimes statute. But he concluded that because hate crimes were well-established in law, other groups should be added even if they lacked "political clout." He introduced the bill four years running before it was finally approved.