A malfunction in a West Campus building Tuesday afternoon sent tens of thousands of gallons of foam and water spewing into a nearby river, killing some local wildlife but leaving no lasting damage.

The released foam, originally intended as a fire retardant, was automatically deployed when a pipe burst and set off the fire-protection system at the vacant B45 building at 400 Morgan Lane. The foam mixed with water from the pipe and eventually forced its way out of the building, across the street and into the East Branch of the city’s Oyster River.

Yale has hired a contractor to clean up the spill, which state and fire officials said should be cleaned during the next few days. Yale spokesman Robin Hogen ’70 said the University apologizes and takes full responsibility for the spill.

West Haven Mayor John M. Picard said that given Yale’s quick response and the nontoxic nature of the foam, the city would not seek damages.

“No hard feelings,” Picard said Wednesday. “Yale addressed it quickly and professionally and has been a very good neighbor.”

“It’s not hazardous, it’s just a nuisance,” West Shore District Fire Chief David Collins added.

Connecticut Department of Environmental Protection spokesman Dwayne Gardner said there will be no long-term environmental damage andthe rain from Hurricane Earl expected this weekend will finish the clean-up of the spill.

Picard said Vice President for West Campus Planning and Program Development Michael Donoghue had been in touch with him throughout the spill, keeping him informed of the cleanup efforts. (Donoghue did not immediately respond to a request for comment Wednesday afternoon.)

At around 4 p.m. Tuesday, firefighters received a fire alert, the result of a fire protection system installed in West Campus B45 before Yale purchased the area from Bayer HealthCare in September 2007. Upon arrival at West Campus B45, they found that the building’s garage had been completely flooded with foam, whichexpanded and forced open the side door of the building, spilling across the street into a storm drain.

The firefighters and a crew from Yale maintenance quickly shut down the spill, but the foam had already reached the river.

Collins said the foam spread down a quarter-mile stretch of the river, leaving it thick with suds. Residents have complained of finding dead fish and eels in and around the river, which still has foam residue a day after the accident, he said.

Workers from McVac Environmental, the firm Yale hired to clean up the scene, will report to state authorities when they finish. Hogen said Yale will check all the pipes of the West Campus buildings but has no plans to remove the foam flame retardant.

“At some point, things are going to fail,” he added.

One of the fire trucks that responded to the scene of the foam spill was given to West Haven by Yale through a $150,000 grant last year.