Updated

Ulster County Executive Patrick Ryan, a Democrat, has won a special election to represent New York's 19th Congressional District where the candidate made the race a referendum on the Supreme Court's abortion rulings in a possible preview of November midterms.

Ryan will fill the seat formerly held by Antonio Delgado, the Democrat who resigned to become New York’s lieutenant governor this summer, and serve as representative for the district until 2023.

The matchup in the Empire State district, which covers New York's Catskills and mid-Hudson Valley regions, may serve as a sign of what's ahead for Republicans in this fall's midterm elections as both candidates brought opposing priorities to the forefront of their campaigns.

In the final week of campaigning to represent the 19th District, which President Biden carried by less than 2 points in the 2020 election, Ryan, an Army veteran, said during a campaign rally in Woodstock that he hopes to "send another message as the national spotlight starts to shift" to Democrats.

NEW YORK SPECIAL ELECTION LATEST TEST OF DEMOCRATS' MESSAGING ON ABORTION

Pat Ryan, Marcus Molinaro

Democrat Pat Ryan and Republican Marcus Molinaro faced off Tuesday in a special election represent New York's 19th Congressional District. (Bill Clark/CQ-Roll Call, Inc via Getty Images)

"Think about the message sent in Kansas, think about the message we can send right here," he said, referencing a ballot decision from voters in the Midwestern state last month that prevented elected representatives from regulating abortion in Kansas.

"How can we be a free country if the government tries to control women's bodies?" Ryan asked in his first ad. "That's not the country I fought to defend." 

At a campaign event held by Molinaro, however, the conversation remained laser focused on issues like crime and the economy.

HEAD TO THE FOX NEWS ELECTIONS CENTER FOR THE LATEST PRIMARY RESULTS

"This is a special election. It is about the voters of the 19th Congressional District. And it is both disingenuous and a bit insulting to tell them what their issues are," he said. "They are fearful for the future and they are concerned about their safety. I hear it everywhere."

Marc Molinaro

Marcus Molinaro, Republican candidate for the New York 19th Congressional district, speaks during the special election candidate forum at the Roscoe Beer Co. in Roscoe, N.Y.  on Thursday, August 18, 2022. (Bill Clark/CQ-Roll Call, Inc via Getty Images)

"Under one-party rule our communities are facing uncontrollable inflation, a government-fostered crime wave and massive tax increases," Molinaro said in a recent social media post. "I'm running for Congress to be the voice that is desperately needed in D.C. to fight this insanity."

Molinaro, once the youngest mayor in America when he was elected to represent Tivoli as a teenager, had name recognition in the race after he ran an unsuccessful gubernatorial campaign against former New York Gov. Andrew Cuomo in 2018.

NEW FACES LOOK TO MAKE WAVES CHALLENGING HOUSE LEADERS IN NY DEM PRIMARIES

Due to redistricting, in addition to the special election on Tuesday to serve out the remainder of Delgado's term, both Molinaro and Ryan are also on the primary ballot for the general election.

Ryan also won the Democratic nomination for a full term representing the state's new 18th District, a seat abandoned by Rep. Sean Patrick Maloney, D-N.Y., who is now seeking to represent the state's 17th District in the House. Ryan will face off against Colin Schmitt, the Republican and Conservative Party nominee who ran unopposed in the primary.

Pat Ryan speaking

Patrick Ryan, Democratic candidate for the New York 19th Congressional district, speaks during the special election candidate forum at the Roscoe Beer Co. in Roscoe, New York, on Thursday, August 18, 2022. (Bill Clark/CQ-Roll Call, Inc via Getty Images)

Molinaro is running unopposed in the Republican primary for a full term to represent the state's new 19th District, where he'll face the winner of the Democratic primary.

CLICK HERE TO GET THE FOX NEWS APP

Originally slated to take place on June 28, a federal judge shifted the congressional and state Senate primary date to Aug. 23 due to the re-drawing of congressional districts. The only elections held in June were for governor and state Assembly seats.

The Associated Press has contributed to this article.