Timothy Madden of Nantucket claimed the Cape and Islands state representative seat on Tuesday, beating out two Vineyard contenders and a Falmouth hopeful by some 2,000 votes district-wide.

And according to Eric T. Turkington, Mr. Madden is taking a difficult job at the state house.

“It’s a trying time,” said Mr. Turkington, who will vacate the position in January after 20 years in the job. Mr. Turkington did not seek reelection.

“The budgets are more constrained, and it will be harder than ever to secure new funding and keep existing funding.

“Funding for programs sounds innocuous — it’s money that goes to the towns to pay for schools. And unlike the fed, the state can’t print money,” Mr. Turkington said.

An enormous show of support for Mr. Madden from his home town of Nantucket shored up his victory at the polls this week. He secured 4,968 votes on Nantucket, 89 per cent of the total ballots cast.

“I’m very pleased with the results,” Mr. Madden said after the election this week, “I did better than I thought on the Vineyard and I’m blown away by the Nantucket result. It’s quite the endorsement from the people who know me best.”

When the votes were counted late Tuesday night, Mr. Madden emerged a clear winner with 9,505 votes. Dan Larkosh, a West Tisbury attorney who won the Democratic nomination in the September primary and fought hard (and spent heavily) for the post, came in second with 7,486 votes district-wide. Melissa Freitag, a college professor and independent from Falmouth, was third with 3,391 votes and Jacob Ferreira, a member of the Coast Guard reserve, was fourth with 3,005 votes.

And while the Nantucket support was unequivocal for Mr. Madden, he was effectively beaten out in the rest of the district by Mr. Larkosh, who won Falmouth, Gosnold and five of the six Vineyard towns (Mr. Madden won Chilmark).

Mr. Madden placed third in Falmouth behind Mr. Larkosh and Ms. Freitag. But he finished a strong second on the Vineyard, where he built a coalition of support among town leaders and residents.

And when it was all over he remained mostly unfazed.

“Most people look at who they know best. I’ve been campaigning here, for want of a better word, for over 20 years. Melissa is new to the [Falmouth] community but did very well — they wanted to have someone in the community,” he said.

Mr. Madden ran as an independent candidate but changed his affiliation to Democrat this week. He said the biggest thing that awaits him at the state house is a fight against cuts in local aid in the budget crunch.

“I think it will be a very busy early part of the session,” he said. He added that tourism and shellfish propagation, two areas that have already seen state cuts this year, should actually be receiving additional funding.

”I’m opposed to local aid and educational cuts, and cuts to tourism and green initiatives,” he said.

Mr. Madden said he started election day waving a sign outside the polls in Tisbury at 6:45 a.m. From there he went on to Edgartown, Chilmark and Falmouth before heading back to vote on Nantucket at 4:30 p.m. By around 11 p.m., he learned he had clinched it.

“It was a very interesting time, bouncing back and forth from Web page to Web page checking results,” he said.

Mr. Madden said he did not do too much celebrating on election night.

“The results didn’t come until late so there wasn’t much celebration, but I went to the Rotary Club for lunch today. It was just fun to be with friends and neighbors,” he said on Wednesday.

Though Mr. Turkington was adamant about not endorsing a candidate during the election, he said he is happy with the result.

“I’m thrilled and I think that the voters made a very good choice,” he said.

He added that he will be happy to step aside.

“I’ve enjoyed this immensely; I’ve made a mountain of new friends,” he said. “I don’t regret a minute of it. But when I made the decision this spring, I thought 20 years is a pretty good time, I was at the peak of my game. Things were quiet on the home front . . . it still seems like a good idea.”

Mr. Turkington ran for register of probate for Barnstable county in this election and lost to Anastasia Welsh Perrino. He said the Islands have not seen the last of him.

“Nantucket and the Vineyard are two of my favorite places. I’ll be back soon,” he said.

Mr. Ferreira of Vineyard Haven, who ran a low-cost campaign and registered strong support on the Island though he came in fourth district-wide, extended his praise to Mr. Madden.

“Congratulations to Tim. He ran a great, efficient race,” said the 28-year-old, “and certainly also to Mr. Larkosh and Ms. Freitag for their efforts. When you’re part of a race you learn how hard it is. I’m thankful to the 3,000 people who voted for me; it’s pretty incredible to ask someone for your vote. I’m happy the way we went about this campaign.”

Mr. Ferreira said he will continue to work on a gardening business and push forward on a project he began as part of the campaign to bring higher education to the Island, in partnership with his college alma mater, Northeastern University.

“I’ll continue to move the ball down the field there,” he said, adding that he will also return to reserve work for the Coast Guard.

“I’ve offered Tim any help I can give. My pledge is to deliver help anyway I can; it doesn’t have to be an official position,” he said.

Mr. Madden will be the second Cape and Islands state representative since the district was formed. He has worked with Mr. Turkington as legislative liaison for Nantucket for the past decade.

Mr. Turkington said he believes the Nantucket liaison position will be abandoned while Mr. Madden is in office. However, Mr. Madden said he thinks the position should continue.

“I will look for a liaison for Nantucket and the Vineyard and hope that money will be in the budget,” he said.

The appointment of liaisons falls to Mr. Madden as state representative. Russell Smith currently holds the part-time position for the Vineyard. Mr. Smith was appointed county manager this year and is scheduled to have a six-month review in December. He said several factors make it difficult to know whether he will be able to apply for the position under Mr. Madden.

“I like doing it,” said Mr. Smith who is in his 12th year as liaison. “Sometimes it’s terrifically interesting. Sometimes it’s mundane.”