A Wisconsin Democrat won a State Senate seat on Tuesday night that had been held by a Republican for 17 years, setting off a flurry of political predictions across a state that President Trump won. Republicans warned that it was a “wake up” call for their party as elections loom in the fall, while Democrats cheered the upset victory as a sign of hope that Wisconsin was back in contention.

In the state’s first special election of 2018, Patty Schachtner, a Democrat and the St. Croix County medical examiner, beat Representative Adam Jarchow, a Republican member of the State Assembly, by 11 percentage points, according to preliminary election returns, decisively taking the seat in a rural western region near the Minnesota border.

“Everything is in play now,” Melanie Conklin, a spokeswoman for the Democratic Party of Wisconsin, said on Wednesday. “This is a district that has been a very red district for a long time, and the numbers last night were very blue.”

The election comes at a tense political moment for the state, with a governor’s race and United States Senate seat at stake in the fall; questions about gerrymandering of state political maps in the courts; and with political observers around the nation watching all sorts of local and state races for signs of what 2018 races may bring for both parties.