A Revere man threatened to kill a state trooper and his family after he was arrested for swinging a hammer and spewing racial epithets at a group of African-Americans yesterday on Revere Beach, according to police.

Gianpaolo Cerretani was arraigned on 10 charges, including a hate crime, in Chelsea District Court today. He was held without bail.

The dispute began after Cerretani stole a football from a small child on the beach, authorities said.

When a group of Hispanic and African-American young men and teenagers took the ball back and gave it to the child, he became enraged and began swinging a hammer at them, shouting racial slurs and calling them “slaves,” police said. When state police responding to the disturbance approached Cerretani, troopers say he threatened them as well, calling an officer a “pig” and saying “I’ll take you too.”

Witnesses said Cerretani, 24, was wrestled to the ground and struck several times to “get him under control and prevent further attack,” court documents show. The hammer used in the alleged attack was recovered on the beach by police, and is 12 inches long with a bloodstained gray and yellow handle, documents show.

One of the men who scuffled with Cerretani was struck with the hammer and suffered a minor injury, but refused transport to the hospital, police said. Cops added they smelled alcohol on Cerretani’s breath and his eyes appeared glassy.

While being treated for his injuries at Whidden Hospital, Cerretani — shirtless and bloodied — yelled at hospital staff, used a racial slur toward an African-American security guard, and during transport told an arresting trooper “I’ll kill you and your family,” police said.

A man who described himself as Cerretani’s roommate was arrested for contempt of court after an outburst in court at the arraignment.

“He’s getting a raw deal, he got jumped over a football, he got jumped over a football,” a man who identified himself to reporters as Scott Petros said as he was taken into custody by court officers. He had been warned by Judge Matthew Nestor to “sit down and be quiet” before being arrested.

Cerretani, represented by defense attorney Richard Barrett, today stood behind glass in the holding area of the first-floor courtroom wearing a black polo shirt and sporting a bruise under his right eye and a cut next to his left eye. He is charged with one court of assault and battery with a dangerous weapon, four counts of assault with a dangerous weapon, disorderly conduct, two counts of threatening to commit a crime, resisting arrest, and a civil rights violation.

Assistant district attorney Kacie Sherman said the Commonwealth was not ready to proceed with a dangerousness hearing and Nestor scheduled the hearing for Thursday.