Sen. Tammy Baldwin (D-Wis.) won re-election on Tuesday, a victory for Democrats in a state that President Donald Trump won in 2016.

Baldwin defeated Republican state Sen. Leah Vukmir in the midterm elections for a second term in the Senate.

From early on, the Wisconsin Senate race was a top prize for the GOP. Conservative groups poured more money into that race to boost Republicans than into any other this cycle.

Wisconsin went for Trump in 2016, after voting for Barack Obama in the previous two cycles. Also that cycle, Sen. Ron Johnson (R) defeated Russ Feingold, a surprise victory in a race where the Democratic former senator was widely expected to win back his seat.

But Baldwin benefited from the massive Democratic momentum nationwide, and she appealed to rural areas that she won in 2012 ― even though they had gone for Trump in the presidential election.

Baldwin, unlike other Democratic senators running in redder states, ran as an unabashed progressive. But in Wisconsin, supporters more often stressed her responsiveness to their concerns and her willingness to work across the aisle ― often on issues that weren’t obviously partisan, such as “Buy America” legislation and dairy farming.

Vukmir, a conservative state senator, won a tough primary against a well-funded opponent, veteran Kevin Nicholson. She is known in southeastern Wisconsin, which she represented in the legislature, but less so in the rest of the state, and she consistently trailed Baldwin in the polls during the campaign.

Republicans tried to go after Baldwin on the issue of veterans and the opioid crisis, saying she didn’t act aggressively enough to address the overprescription of opioids at a Veterans Affairs facility in the state. But Baldwin emphasized legislation she passed on the issue, and she received the support of the family members of a Marine who died at the medical center.

Baldwin also opened up about her own mother’s addiction to prescription drugs and released a personal ad talking about it.

Vukmir also ran on immigration, characterizing Baldwin as being “part of an angry liberal mob” that was stopping Trump from building his wall on the border with Mexico, and she supported repealing and replacing the Affordable Care Act.

Baldwin was first elected to the House in 1998. She served there until winning an open seat for the Senate in 2012. She is the first openly gay woman elected to Congress and the first openly gay person elected to the Senate.