BANGOR, Maine — Two Bangor firms that restore historic buildings have signed an agreement to save a 125-year-old engineer’s house on the former city waterworks property, they said Monday.

Architects at Ames Associates, LLC and contractors at House Revivers have until March 31 under their purchase and sale agreement with property owner Shaw House to complete their permitting and pay $1 to buy the building on State Street opposite Cascade Park, said Bob Kelly, co-owner of House Revivers.

The building’s restoration could cost $350,000 to $450,000, said Ellen Angel, a senior architect and principal at Ames. The buyers won’t have a better estimate of the renovation costs until Kelly finishes his review of the two-story property. They hope to acquire historic preservation funding and move Ames Associates from 128 Broadway into the building as early as next winter.

“It is such a magnificent part of Bangor history, we don’t want to see it go. This is a fabulous opportunity to save it,” Angel said Monday. “As a company, we do a lot of historic renovation work, so it seemed like it was right within our wheelhouse to take this on.”

“That’s a really fabulous building that should not have been allowed to deteriorate to the extent that it has,” Angel added.

Shaw House program director Rick Tardiff said he was pretty sure that the homeless and at-risk youth service agency would give the firms plenty of leeway on the deal.

Tardiff’s organization acquired the house and historic waterworks facilities as part of a $6.8 million plan, completed in 2007, to convert the site into Waterworks Apartments — 35 rent-subsidized efficiency apartments for very low-income adults at risk of homelessness. Shaw House replaced the roof of the engineer’s house and added a new foundation at a cost of $79,000 when they moved the building 15 feet to accommodate a driveway to the apartment complex.

Shaw House officials later determined they couldn’t afford to further restore or maintain the deteriorating house and received approval last August to raze the building. But Monday, Tardiff said he “never pursued the demolition route because obviously this is a wonderful opportunity to keep that structure intact.”

“This is a win-win, I think,” Tardiff said. “We are delighted. Bob is awesome. They are fantastic and he will finally breathe new life into that building. As somebody who was born in Bangor, I am delighted that this is finally happening.”

Ames and House Restorers began negotiating the deal with Shaw House leaders and other principals involved in September. They signed the purchase and sale agreement on Jan. 31, but announced it only recently because many details first had to be finalized, Kelly said.

The engineer’s house is historically valued because it was designed in 1892 by architect Wilfred E. Mansur. Arguably the preeminent local architect of his time, Mansur designed dozens of homes, government buildings and downtown offices in Bangor. Built originally for just under $2,800, the house is unique among Mansur’s portfolio for its gambrel-roofed, wooden-shingle styling, Kelly said.

“It is one of only a handful of buildings that he did in shingle style. It might be the only one left,” Kelly said.

That house, known by some as the gatekeeper’s or superintendent’s house, served the city’s water department until the late 1950s, when Bangor and five surrounding towns formed a water district and built a new water system, leaving the old waterworks facility vacant.

The waterworks facility and house fell into disrepair in the decades that followed, the victim of frequent vandalism, squatting and inattention. The engineer’s house was boarded up and has remained vacant since the 1970s.

It has fallen into such disrepair after more than 40 years of vacancy that a structural engineer, during a 2016 walk-through of the building, fell through the floor and had to abandon his inspection.

The prospective owners will go before the city’s Historic Preservation Commission on Thursday to seek permits to renovate the building’s exterior. The meeting is set for 7 p.m. at City Hall, Kelly said.

BDN Writer Nick McCrea contributed to this report.