A new Edgartown Public Library, approved by town voters and hinging on state funding, took a giant leap toward reality Thursday.

Edgartown was awarded a $5 million grant Thursday from the Massachusetts Board of Library Commissioners, one of eight towns to receive $41.8 million in construction grants from the state.

In April, town meeting voters approved $4.9 million in funding for a new, roughtly 15,500-square-foot town library to be built at the site of the old Edgartown School on the Edgartown-West Tisbury Road. Plans for the new library call for more books and computers, a community meeting space and more parking.

The town has been engaged in a long effort to replace or renovate the current library on North Water street, a brick building built in 1904 using a donation from philanthropist Andrew Carnegie. In 2005 the town bought a neighboring building, the Warren House, with an eye toward expanding the library, but plans were scrapped because of logistical problems. The town is in the process of selling the Warren House, and the Martha’s Vineyard Preservation Trust has expressed interest in taking stewardship of the library building after the new building is complete.

The award puts the library ahead of its anticipated schedule; library trustees had expected to receive the grant money in 2013. Construction is expected to take two and a half years.

In 2011, Edgartown was one of 28 libraries in the state to apply for library construction grants, and ended up fourth on the waiting list.

“We are beyond thrilled and grateful to our local legislators who worked hard to make this money a reality,” said library director Jill Dugas Hughes in a statement.