Scarborough voters overwhelmingly approved a plan to borrow $39 million to replace the problem-plagued Wentworth Intermediate School.

The unofficial results of the vote were 4,792 in favor and 2,784 opposed.

Since 2006, the school district has spent $1.3 million fixing up the nearly 50-year-old school, including a recent roof replacement that’s only under warranty for five years because the substructure is in poor condition, said Paul Koziell, chairman of the 40-member building committee that developed the Wentworth proposal.

“It’s a tremendous victory, absolutely,” Koziell said Tuesday night. “We put together the right project, we looked at all the information and the voters agreed with us.”

Had voters decided not to replace Wentworth, as they did in 2006, school officials anticipated spending as much as $2.5 million over the next three years to address new and ongoing problems with the building, including crowding, mold and asbestos-contaminated window casings.

Wentworth was built as a junior high school in 1963. A wing was added in 1974 and portable classrooms were added in 1988. Today, the school has 16 portable classrooms.

The school serves 775 students in grades 3 through 5. It also hosts community recreation programs and its kitchen produces meals for the town’s three other elementary schools, as well as Wentworth students.

The new school will be built beside the existing building, which will be torn down afterward. Construction is scheduled to begin in 2012 with the new school opening in 2014.