SCARBOROUGH, Maine — Two-term Rep. Amy Volk, R-Scarborough, unseated incumbent first-term Sen. Jim Boyle, D-Gorham, in the Nov. 4 election to represent state Senate District 30.

Volk out-polled Boyle 10,089 to 9,128, a margin of 6 percent, in the district that covers most of Scarborough, Gorham and part of Buxton.

Boyle eked out a narrow win of about 500 votes in his hometown, while Volk won by about the same number in Buxton. In Scarborough, her margin was 4,991 to 3,824.

“I thought it might be closer than that,” Volk said after ballots were tallied Wednesday.

She credited her win to a positive campaign.

“People were tired of the finger-pointing and negativity,” she said. “They saw someone who was positive and stayed on message.”

Contributing to a new Republican 20-15 majority in the Senate, the District 30 race was one of the most-watched state-level contests. The race was also this year’s costliest legislative election, with a total of more than $330,000 spent on behalf of the candidates, according to campaign finance reports.

Two-thirds of that amount went to support Boyle, a Clean Elections candidate who was heavily backed by political action committees and other groups. Much of the spending for Boyle paid for attack ads aimed at Volk.

But Boyle said he wasn’t responsible for the negative campaign.

“It was difficult for me to be portrayed as someone who was negative, because I really didn’t attack Amy,” he said Wednesday afternoon, suggesting the negative ads aired on his behalf were a surprise.

“I didn’t even know about them until I saw them on TV,” he said.

Like Volk, Boyle said he expected the election outcome to be closer, albeit with a different winner. Last year’s mandated redrawing of electoral lines may have contributed to the result, he said.

In 2012, Boyle was elected by 2,000 votes in what was formerly District 6, which included part of Westbrook. The creation of District 30, though similar, swapped that out for a portion of more rural Buxton.

Volk opted not to seek re-election in House District 29, formerly District 127, in order to challenge Boyle. The Senate needs more women, who are “natural bridge-builders,” she said in September.

Both candidates described themselves as political moderates. Volk’s campaign focused on goals that included reducing the size of the state budget and lowering the state income tax. She also stood behind Gov. Paul LePage’s welfare reform efforts. Boyle ran on a campaign that emphasized his work to protect the environment, increase the use of renewable energy and grow jobs.

The candidates differed in their opinions of private charter schools. Boyle opposed them, whereas Volk, a lead House sponsor of the 2011 bill permitting charter schools, is an advocate.

In the House, Volk sits on the Labor, Commerce, Research and Development Committee, where she is lead minority member. She also has served on the governor’s State Workforce Investment Board and was a founding member of the bipartisan “Gang of 11” tax reform group.

She said some of her most notable accomplishments have been her contribution to overhauling workers compensation law and her bill to better protect victims of sex trafficking, which was passed unanimously as emergency legislation last spring.

Despite four years in the House, Volk said the move across the state House has been a daunting one.

Her previous campaign teams consisted mostly of family members. Her Senate victory required the support of volunteers, interns and other Republican candidates. And, with much more ground to cover, that meant many more campaign signs.

“There’s a huge difference between a House and a Senate race,” she said, noting the latter was a “whole different animal.”