Arthur Gallagher, the town accountant for Oak Bluffs, died unexpectedly on June 13.

Credited with establishing fiscal controls that helped lead the town out of a three-year budget crisis, Mr. Gallagher moved to Martha’s Vineyard soon after he was hired in 2010. He lived in Edgartown. Previously he served as town accountant in the Massachusetts communities of Bedford, Framingham, Wilmington and Weymouth.

According to Oak Bluffs town administrator Bob Whritenour, Mr. Gallagher was at work on June 2, when he was taken to the Martha’s Vineyard Hospital with a medical emergency. He underwent surgery a few days later, and was recovering well, he said.

“He did a lot of good for the town,” Mr. Whritenour said. “The town owes Arthur Gallagher a debt of gratitude. His contribution to our town was very much appreciated."

The death of Mr. Gallagher, who was 62, comes at the busiest time of the year for the town’s fiscal officers, as they work to close the books on the 2016 fiscal year.

Last week selectmen approved hiring Richard Bienvenue, a certified public accountant from Yarmouth, to work in the accounting department through Sept. 2.