A fire raged across three blocks in a city near Albany on Thursday after a man tried to forge a piece of metal over a fire in a barrel near his home, officials said.

The fire destroyed three residential buildings and damaged 28 others in the city of Cohoes, displacing as many as 28 people, Shawn Morse, the mayor, said in an interview on Saturday. No serious injuries were reported.

John Gomes, 51, the resident who is accused of starting the blaze near his home, was apparently inspired by “Forged in Fire,” a television series on History (formerly known as The History Channel) in which bladesmiths compete to create swords and other edged weapons.

“He was trying to bend metal and make a hammer or something,” Mr. Morse told reporters on Thursday. But the winds were not in Mr. Gomes’s favor.