A complicated deal 12 years in the making that will create affordable housing, add conservation land and save a historic home in Chilmark was finally completed Monday.

Chilmark town officials and Martha’s Vineyard Land Bank executive director James Lengyel gathered at town counsel Ronald H. Rappaport’s office Monday afternoon to finalize a 2007 agreement between the town, the land bank and the Howard B. Hillman family.

At the meeting Monday, Mr. Rappaport recounted the history of the process. It all started in 2002, he said, when the land bank and the town purchased the former Burton Engley property off Middle Road.

The goal was to turn the historic home into affordable housing. In 2003, members of the Hillman family approached former selectman Frank Fenner with a better idea. The Hillman family owns more than 100 acres of land around the Engley house, and they proposed having a family trust take ownership of the Engley home in exchange for granting trail easements on the property and donating 10 acres to the town for affordable housing and the land bank.

What followed was “a Herculean effort,” Mr. Rappaport said. The deal was negotiated for four years and required approval from Chilmark voters and the state legislature.

The agreement was signed in 2007, but shortly after the Hillmans decided they did not want to proceed, Mr. Rappaport said. The town brought a lawsuit. In January, a superior court judge found in favor of the town and the deal was allowed to proceed.

“So we’re here today, 12 years after the process started with a result that’s terrific,” Mr. Rappaport said. “Everybody wins,” he said, noting that the town gets affordable housing, the land bank gets trail easements and the Engley house gets new ownership.

“The Hillman family should be thanked for coming forward and agreeing to do this,” he said. He also praised Mr. Fenner, who was in attendance, for his effort.

With that, Mr. Lengyel signed the final documents for the agreement. The Chilmark selectmen signed the agreement at a meeting about 10 days ago.

“Here we are adding four affordable housing sites to the town of Chilmark,” selectman chairman Warren Doty said, noting that the town needs twice as many but “four is a good number."

Four plots of land off South Road, each a little larger than an acre, will now be available for qualified applicants to lease. Those interested should go to Chilmark town hall, and will have to be qualified by the Dukes County Regional Housing Authority. There is already one interested party.

Mr. Doty said the selectmen will have to decide whether to lease them all at once or start with two. Each resident will lease the land for 99 years, and the lessees can build their own homes in clearly defined building envelopes.

The town will build an access road, four wells and four septic systems. The land bank will build a trail through the property and a trail head off South Road, and through new trails and easements, there will soon be a trail connection between North Road and South Road.

The group gathered applauded after Mr. Lengyel wrote his name.

“Don’t you do one letter for each pen?” Mr. Doty joked.