Democratic Rep. Jacky Rosen won an upset in the U.S. Senate race Tuesday night over incumbent Republican Dean Heller in one of the most closely fought and closely watched contests in the country, although Democratic losses in three key races elsewhere in the nation allowed Republicans to retain control of the upper chamber.

Rosen, a first-term congresswoman with no prior political experience, defeated Heller, who has spent nearly three decades in Nevada politics, by a 5-point margin though the two had appeared relatively close in polls in the days leading up to the election. It was a stark contrast from the outcomes of tight races in North Dakota, Missouri and Indiana, where Democrat incumbents lost to their Republican challengers.

Democrats also managed to hang on to the state’s two competitive House seats as their party nationwide wrested control of several seats from Republicans, allowing Democrats to capture control of the lower chamber. Republican businessman Danny Tarkanian lost again in Nevada’s 3rd Congressional District to Democratic education advocate and philanthropist Susie Lee, while former Rep. Steven Horsford will again represent Nevada’s 4th Congressional District after defeating another former representative of the district, Republican Cresent Hardy.

For Rosen, the victory in the U.S. Senate race meant coming full circle. She delivered her victory speech at a watch party where Democrats had gathered at Caesars Palace, the same place she had worked as a cocktail waitress in college.

“I put my tips in those envelopes and it paid for my next year of college,” said Rosen, 61. “And I know it took a while, but 40 years later I'm back, and here I am."

During the speech, Rosen thanked Heller for his 30 years of service to the state, saying he had given her a “gracious” call.

“That's what we call a mensch,” she added, using the Yiddish word for man of integrity.

Rosen reiterated promises to fight for a $15 an hour minimum wage, affordable higher education, gun safety legislation, voting rights, immigration reform, clean energy and women’s reproductive rights, frequent themes of hers on the campaign trail. She also said she would oppose cuts to Social Security and Medicaid.

“And we have the biggest fight of all, one that binds each and every one of us,” Rosen said. “Because if you don't have your health, you don't have anything, so I will never stop fighting to protect our health care.

Heller, in a concession speech, congratulated Rosen on a hard-fought race and reflected back on his 30 years of public service. He pointed to the passage of the tax reform bill in December and the appointment of two conservative justices to the U.S. Supreme Court as two signature accomplishments.

“Those are big achievements, and I was part of the United States Senate when that happened,” Heller, 58, said.

But he also said that he looked forward to helping Rosen with the transition and that he was sure that she would be able to fill his shoes and serve the state of Nevada.

“So to her, congratulations. Best of luck. She’s my senator, and if there’s anything I can do to help her in this transition myself and my staff will be willing to do so,” Heller said. “But to all of you that have supported me for the last 30 years in public office, thank you. It has been a joy. It has been an honor to serve the state of Nevada.”

Heller started off the race as the most vulnerable Republican incumbent up for re-election this year, holding the distinction of being the only member of his party in the Senate running for re-election in a state Hillary Clinton won in 2016. Democrats recruited Rosen to challenge him for the seat in the hope that her background as a former computer programmer and synagogue president — and short political record — would make it difficult for the Republican senator to lob any meaningful criticisms at her.

But Heller, who first entered politics in 1990 and had never lost an election until Tuesday, managed to keep the race close with the two candidates polling essentially neck and neck up until election day. Rosen won with 50.4 percent of the vote, while Heller secured 45.4 percent.

Rosen sought to make health care the focal point in the race, highlighting Heller’s vote in favor of moving a bill to repeal and replace the Affordable Care Act forward to debate. Her campaign ran ads featuring an orange inflatable tubeman calling Heller “Senator Spineless” in an election year in which polls showed health care was the top of mind issue for Nevada voters.

Heller attempted to make an issue of Rosen’s inexperience, running ads saying that she had accomplished “zero” in the House before making a bid for the U.S. Senate. He also attacked her over immigration and campaign donations she received from California.

Nevada’s 3rd Congressional District

In the 3rd District, Lee won a surprisingly comfortable 52 to 43 point victory over Tarkanian in this swing House seat, which stretches from suburban Summerlin and Henderson to rural Searchlight. The campaign largely played out as a repeat of the 2016 campaign in which Tarkanian had faced off against another moderate Democrat, Rosen, for the seat and lost by only 1.2 percentage points.

The win represents the first time that a Democrat has won the district — created after the 2000 redistricting — during a non-presidential election. The only other two Democrats to represent the seat won in presidential years, Rep. Dina Titus in 2008 and Rosen in 2016. All of the district’s other representatives have been Republicans.

Lee, in a statement, promised to fight to lower health-care and prescription drug costs, invest in education and create quality jobs.

“Tonight, Southern Nevada voters sent a clear message — they want leaders in Washington who will work to find common ground and bring people together,” Lee said. “This was a hard-fought campaign, but now is the time to come together — Democrats and Republicans — and move forward as one country.”

Tarkanian, running in his sixth election for public office, faced a litany of attacks in campaign ads over his past business dealings, including his role as a registered agent for several companies later found to be running telemarketing scams (an attack he once won a defamation lawsuit over), a $17 million judgment obtained against him by a federal government agency in the wake of a real estate deal gone bad, and several hundred thousand dollars he received in salary and loans from the children’s basketball charity he runs.

In an interview, Tarkanian blamed his loss in part on the negative ads.

“They’re the same lies that they made in other races that I’ve won lawsuits on,” Tarkanian said, adding that his campaign didn’t have the resources to combat the attacks.

He added that he doesn’t have “any intention” to run for office again and said that he planned to go home and see his kids.

“We lost. Our race is over,” Tarkanian said.

Lee, meanwhile, faced similar lines of attack to those used against Rosen two years ago, with Republicans attempting to tie her to House Minority Leader Nancy Pelosi. She also faced attacks seeking to paint her as out of touch by highlighting the 17 properties she owns with her casino executive husband, which were used against her during her unsuccessful 2016 primary campaign for Nevada’s 4th Congressional District.

The Republican businessman, son of the late UNLV basketball coach Jerry Tarkanian, only jumped into the race after President Donald Trump encouraged him to abandon a Republican primary challenge against Heller for U.S. Senate. Heller, the more moderate candidate of the two, faced a serious threat in Tarkanian who has never held office before but is known for his ability to win Republican primaries and had been an ardent supporter of Trump’s since the 2016 election while Heller once said he was “99 percent” opposed to then-candidate Trump.

“It would be great for the Republican Party of Nevada, and it’s unity if good guy Danny Tarkanian would run for Congress and Dean Heller, who is doing a really good job, could run for Senate unopposed!” Trump tweeted.

Tarkanian faced serious primary challenges in state Sen. Scott Hammond and former television reporter Michelle Mortensen, though he easily won the nine-way Republican primary in June with 44 percent of votes. Lee faced no serious Democratic challengers and easily coasted to victory in her primary.

Tarkanian bet his campaign on the popularity of Trump and his “America First” agenda would carry him to victory, often talking on the campaign trail about the economy, the U.S. relationship with North Korea, border security and school choice. Lee focused her attention on where she believes the administration has fallen short over the last two years, including Republican attempts to repeal and replace the Affordable Care Act.

Outside groups poured about $10.3 million into the race, making it the 26th most expensive race this year — even behind Nevada’s 4th Congressional District, which placed 23rd — after being the most expensive race in the country in 2016.

Nevada’s 4th Congressional District

Democratic former Rep. Steven Horsford scored a comfortable victory over Republican former Rep. Cresent Hardy in Nevada’s Democratic-leaning 4th Congressional District, winning with 52 percent of the vote to 44 percent garnered by Hardy.

The race pitted two former rivals — Hardy beat Horsford for the seat in 2014 — but far higher turnout this cycle tipped the balance toward Horsford. Horsford will replace Democratic Rep. Ruben Kihuen, a freshman who is not seeking re-election after facing allegations of sexual harassment that emerged last December.

“Nevadans made clear that the chaos coming from this Administration is unacceptable; that Congress must do its job and represent all of us, not just the wealthy and well-connected,” Horsford said. “The last two years have been difficult, but today we start to turn the page, today we become the change we want to see in the world.”

Horsford and his supporters raised and spent more than Hardy did, although Hardy got a boost late in the cycle with visits from Vice President Mike Pence, Eric and Lara Trump, House Speaker Paul Ryan and House Majority Leader Kevin McCarthy.

Hardy un-endorsed President Donald Trump in the final weeks of the 2016 campaign that he lost, but has since said he regrets that decision and has a high opinion of Trump as a person. He has run as a candidate who would stand by Trump and help continue the president’s policies, which he credits for a strong economy.

Horsford criticized Hardy as a “rubber stamp” for Trump and sold himself as a check on the president. He has particularly honed in on health care, projecting himself as the candidate with a plan to reduce prescription drug prices and as the candidate who will truly support protections for pre-existing conditions because of his support of the Affordable Care Act.

On Tuesday night, Hardy tweeted his congratulations of his opponent.

“A few moments ago I had the pleasure of calling @StevenHorsford and wishing him all the best as he represents #NV04,” he wrote. “Peri and I, and our whole family, are praying for his success.”

Nevada’s 2nd Congressional District

Republican Rep. Mark Amodei beat Democratic challenger Clint Koble with 58 percent of the vote in Nevada’s deep red 2nd Congressional District, which covers most of Northern Nevada.

Amodei, who first came to Congress in a special election in 2011, retained his seat by a 15-point margin as of Tuesday night. The margin of Amodei’s victory could grow on Wednesday as rural counties, which comprise most of the district, finish reporting their full results.

Koble, a former state director for the Department of Agriculture’s Farm Service Agency, emerged as the frontrunner after a crowded Democratic primary but was largely unknown to voters. A Democrat has never been successful in the district. Jill Derby, a regent in the Nevada System of Higher Education, came closest in 2006 when she was running against then-Secretary of State Dean Heller.

Nevada’s 1st Congressional District

Democratic Rep. Dina Titus easily swept to re-election on Tuesday, defeating little-known Republican Joyce Bentley with 66 percent of the vote in the heavily-Democratic district.

Jacob Solis, Joey Lovato, and Riley Snyder contributed to this report.

Updated 11-7-18 at 3:30 p.m. to reflect the most recent vote totals.