MIDDLETOWN — Stephanie Hansen won Saturday’s special election for the 10th Senate District, guaranteeing the Democrats will remain in control of the Delaware Senate.

Ms. Hansen defeated Republican John Marino and Libertarian Joseph Lanzendorfer by pulling in 58.1 percent of the vote. Mr. Marino received 40.8 percent, while Mr. Lanzendorfer earned 1.1 percent.

The win means Democrats, who have held the Senate for the past 44 years, will continue to do so. The party in charge of the chamber sets the daily agendas, determines committee assignments and chooses what committees bills get assigned to.

“This was a high-stakes election that was divisive for some, but now is the time for us to come together as Democrats, Republicans and independents and work toward a common good for all of our state,” Ms. Hansen, a former New Castle County Council president, said in her victory remarks.

“While the nation’s focus remains on this race for one more night, let us set an example for the rest of the country and show them what the Delaware Way means – and why it matters.”

Delaware is one of just six states with Democratic legislatures and a Democratic governor. With such high stakes, the campaign featured serious spending and even an appearance by a former vice president.

The campaign was the first legislative race in state history to surpass $1 million, with the bulk of that sum coming from Democrats. Political heavyweights like Gov. John Carney, the members of Delaware’s congressional delegation and former Vice President Joe Biden campaigned on Ms. Hansen’s behalf, with Mr. Biden’s support drawing some national attention.

On Saturday, once the results were confirmed, Mr. Biden made a congratulatory call to Ms. Hansen while Democrats around the nation cheered the result.

The big money involved, the potential for a major shift in the state’s political landscape and the fact many Democrats saw Saturday as a referendum on President Donald Trump led to a spotlight being shined on the race, boosting donations and voter turnout.

Republicans had been leaning heavily on a theme of “one-party control,” arguing Delaware has suffered over the past eight years, when the Senate, House and governor’s office have all been held by the Democratic Party.

A victory by Mr. Marino would have led to a major shift in the state’s political landscape and hindered Gov. Carney’s ability to enact his agenda over the first two years of his term.

The new Trump administration also played a part in the election.

“We have turned back the awful, horrid, hateful wind from Washington and turned it back and away from Delaware,” Ms. Hansen said.

She said the campaign featured more than 1,000 volunteers and donations from all 50 states.

Senate Minority Whip Greg Lavelle, R-Sharpley, said he was disappointed with the result but not overly surprised, given the advantages Ms. Hansen had in voter registration and money.

Mr. Marino was not available to comment.

The Middletown-area district includes about 6,000 more Democrats than Republicans. Mr. Marino came very close to winning the office in 2014, garnering 49 percent against incumbent Sen. Bethany Hall-Long.

The 10th District seat was vacated in January when Sen. Hall-Long resigned to become lieutenant governor, leaving the Senate knotted at 10-10.

Saturday’s election saw a voter turnout of 35.2 percent. For comparison, 36 percent of voters cast ballot in the 2014 general election, and the last legislative special election, a 2015 contest for the 18th Representative District, saw just 10 percent of voters turn out.

However, the contest was not without its hitches. Election Commissioner Elaine Manlove said a voter received a call earlier in the day stating Ms. Hansen had dropped out of the race. Ms. Manlove said information was relayed to the Department of Justice to determine whether to pursue the allegation.

Some Republicans were also irked that some residents under 18 were allowed to vote. According to state law, Delawareans who will turn 18 before the next general election and had already registered to vote were able to cast a ballot Saturday.

Sen. Lavelle said that some people under 18 could vote was an “unintended consequence” of a law passed several years ago and something that the Department of Elections should have notified the General Assembly about.

A 2010 law that allowed individuals to register before age 18 states “such applicant shall not be a qualified voter unless the person will be 18 years of age or older on or before the day of the general election next succeeding the applicant’s registration.”

With the chamber tied at 10-10, Republicans held more power than they have had since losing the House in 2008, and the party made us of it, blocking Natural Resources and Environmental Control Secretary nominee Shawn Garvin.

Saturday’s outcome means Mr. Garvin should be confirmed by the Senate once the legislature reconvenes next month. It also makes it more difficult for the GOP to enact any of its goals, such as right-to-work laws.