Republican Jeff Flake won Arizona's U.S. Senate race over Democrat Richard Carmona Tuesday night, with 50.4 percent of the vote.

Carmona, recruited by President Barack Obama for the race, had 45.2 percent. Libertarian Marc Victor collected 4.4 percent.

The race captured national attention almost as soon as it began, and it has remained in the spotlight ever since.

Flake, a six-term member of the U.S. House, and Carmona, a former U.S. surgeon general under President George W. Bush, faced off in a race that grew more contentious as Election Day approached. Libertarian Marc Victor also was on the ballot.

Carmona conceded in an emotional speech that highlighted his campaign team's hard work.

"We can still walk away from this race with our heads held high," he told a cheering crowd of supporters. "It's a privilege to be a part of this great community and this country that has given me so much."

Watch Carmona's speech:

Flake will succeed three-term Republican Sen. Jon Kyl, who has served as the GOP's second in command for the last six years under Minority leader Mitch McConnell.

As the race progressed through the summer and the fall, Carmona’s campaign erased a lack of name recognition and brought the campaign to within the margin of error in most polls.

The campaign centered on many of the same issues being debated nationally: the economy, health care and the federal budget debt and deficit. Both candidates tended to stick to their parties’ talking points on those topics.

Democrats tried to paint Flake as a Washington insider, while Republicans portrayed Carmona as lacking experience and tied to President Barack Obama.

Toward the end of the campaign, the Flake camp brought out old allegations of Carmona beating on the door of a female supervisor while he was surgeon general. Carmona’s campaign quickly responded by trying to discredit the woman.

In turn, the Carmona campaign released an ad showing Kyl and fellow Arizona Sen. John McCain, both Republicans, praising the Democrat. The footage was from Carmona’s confirmation hearing for surgeon general a decade ago. Kyl and McCain responded by saying the ad showed what they said was Carmona's willingness to deceive voters.