The mayor of Denver, voicing concern about the “very real risk” of injury to children, said Friday he would veto a measure passed by the City Council that would have repealed the city’s 30-year ban on pit bulls.

The mayor, Michael B. Hancock, said he had received passionate comments from thousands of residents on both sides of the issue but could not “in good conscience” sign the repeal, which passed the City Council on Monday.

“At the end of the day, I must ask whether passage of this ordinance would make our homes and neighborhoods safer or pose an increased risk to public safety,” Mr. Hancock wrote in a letter to the City Council, which he posted on his Twitter account. “I have concluded that it would pose an increased risk.”

Pit bulls were banned in the city and county of Denver in August 1989, after what Mr. Hancock said were several fatal attacks, including one that he said killed a 2-year-old.