AMHERST - The University of Massachusetts celebrated the completion of a seven-year, $27.2 million fire safety program that now provides a sprinkler system in every room and every dorm on campus.

Standing in Thoreau House, the last building to receive sprinklers, State Fire Marshal Stephen Coan called it "an incredible accomplishment." Such a system "is like having a firefighter right there with a hose."

He said the system not only will make all those living there safer but will protect firefighters as well because sprinklers contain fires before firefighters arrive.

Donald Robinson, of the university's Health and Safety Department, said they put in the system "not because of regulations (but) because it was the right thing to provide a safe environment" to the nearly 12,500 who live on campus.

The state provided $4.8 million in state funds and UMass financed the rest through the UMass Building Authority.

Eddie Hull, executive director of residential life, said the campus has the fifth largest student body living on a campus in the country.

While UMass has never had a fatal fire, in 1977 a fatal fire at Providence College started the process of improving fire safety here. "I was here at that time," Robinson said.

Later, a 2000 fire at Seton Hall University in South Orange, N.J., led former Vice Chancellor for Administration and Finance Joyce Hatch to push further for the system, according to a press release. Three died and 56 were injured in that fire.

The sprinkler system addition was part of a multifaceted fire safety project on campus with upgrades in the smoke detector system as well.

Sprinklers that had already been installed in Cance Hall, a four-story dorm in the Southwest complex, doused a fire in a room there in January 2011. That fire started because a window shade caught fire from a candle. Candles are not allowed in the dorms.

Tanner Houle, a freshman from Chelmsford, said he doesn't think about fire safety. But he said he does feel safer knowing there's a sprinkler right above his bed. "I'm a heavy sleeper, if anything did happen," he knows the spray would wake him.

Tom Penfield, a senior who is also a resident assistant, said he feels safer with the system and said it was money well spent. "You can never put a price on safety." Both live in Thoreau.