MILWAUKEE, WI - NOVEMBER 04: Wisconsins State Senator Tammy Baldwin (D) speaks to supporters as Democratic candidate for Wisconsin Governor Tony Evers as he makes a campaign stop at the Coordinated Campaign southside office on November 4, 2018 in Milwaukee, Wisconsin.

Democratic Sen. Tammy Baldwin won her re-election bid in Wisconsin, defeating Republican Leah Vukmir in Tuesday's election, according to an NBC News projection.

The race attracted national attention and brought President Donald Trump to the Badger State in the final weeks to stump for Vukmir.

In recent months, Baldwin — a one-term liberal Democrat and the nation's first openly gay U.S. senator — had been leading Vukmir in polling by double digits and enjoyed a money advantage. Baldwin spent about seven times as much as her conservative Republican challenger and raised more than $27 million compared with Vukmir's roughly $3 million haul as of Oct. 17.

Health care was a key issue, with both candidates promising to protect people with pre-existing conditions but disagreeing on the extent of government involvement in health plans and the role of private insurance companies. The two also disagreed on Trump's trade policies, which have led to tit-for-tat tariffs against some of Wisconsin's key industries such as agriculture and manufacturing, including Harley-Davidson motorcycles.

At a Wisconsin rally with Trump just a few weeks ago, Vukmir — a state senator and nurse — called Baldwin's health plan "chaos for all because she wants to destroy and dismantle Medicare." A few days later, former President Barack Obama stopped in Wisconsin for a rally with Baldwin and skewered GOP leadership for considering cuts to Medicare and Social Security to get the federal deficit down.

On trade, Baldwin criticized the Trump administration's policies as "haphazard" since they didn't only target China but went after allies such as the European Union, Canada and Mexico and resulted in retaliatory tariff hitting Wisconsin's cheese sector and Milwaukee-based Harley-Davidson.

Vukmir, though, sided with Trump and said the president was negotiating better deals, beating China. She added that the Wisconsin farmers and manufacturers she's talked to were supportive of the administration's trade policies and were willing to wait for the benefits of Trump's aggressive moves.