A Texas congressional candidate who favors marijuana legalization beat eight-term incumbent El Paso Rep. Silvestre Reyes Tuesday in the Democratic primary for the congressional district closest to Mexico's Ciudad Juarez.

In unofficial results, Beto O'Rourke scored 23,248 votes for 50.5 percent of the vote, clearing the 50 percent threshold needed to avoid a runoff. Reyes tallied 44.4 percent. The 2012 Democratic primary boasted more than 10,000 additional voters over 2010, sending turnout up from 9.8 percent to 14.2 percent.

"Can you all just confirm for me that this is really happening?" O'Rourke asked a crowd at his victory party after the results came in, according to the El Paso Times. "I want to thank all of you for making this possible."

Reyes was less exuberant in defeat, slamming "my opponent who deliberately ran a nasty, dirty campaign."

The race received national attention because of O'Rourke's position in support of marijuana legalization. In his second term as an El Paso city representative, O'Rourke pushed for a resolution calling for a re-examination of the drug war, which has killed tens of thousands in neighboring Mexico over the past decade. He also co-authored a book on the same subject.

The drug war is "a failure," O'Rourke told HuffPost in April, adding that marijuana is "the cornerstone of the cartel economy" and thus fuels the violence in El Paso's sister city.

Reyes, a Vietnam veteran and former border patrol officer, responded with a TV ad charging that O'Rourke was encouraging drug use among children.

This is the second high-profile Democratic primary this month where the candidates squared off over marijuana prohibition. On May 15, Ellen Rosenblum won the Oregon attorney general's office on a pledge to make enforcing marijuana laws a low priority.

In the final weeks of the Texas race, O'Rourke had somewhat downplayed his views on legalization. He said that it was a low priority for El Paso voters and not something he would pursue in Congress.

"He's backed off a lot on the talking points about the need to legalize marijuana or the impact it has on this border community," said Richard Pineda, associate director of Sam Donaldson Center at University of Texas El Paso. "I think that it's unlikely he's going to be a champion for that issue."

Local political observers dismissed the idea that pot policy had much to do with voters' ballot box decisions.

"Other, bigger issues have come into play," said Gregory Rocha, an associate professor of political science at the University of Texas-El Paso. Foremost among them, he said, was a perception that Reyes had become an entrenched, corrupt incumbent. The congressman was hit hard by allegations that he had steered $600,000 in campaign funds to himself and his family members via consulting jobs.

Those charges were pushed by the Campaign for Primary Accountability, an anti-incumbent super PAC that targeted Reyes with what it said were $245,000 in independent expenditures. Much of that money was spent on negative television ads.

"They've done the dirty work," said Rocha. "Just like what we've seen in the Republican campaign: the super PACs did the dirty work for Mitt Romney."

After O'Rourke won, the super PAC, which Reyes had criticized for accepting money from wealthy GOP donors who include Joe Ricketts, released a statement: "Rep. Reyes had all the benefits of incumbency. Beltway lobbyists showered money on their long-time friend while Washington party leaders with marquee names tried to lend him their stature.

"The voters exercised their franchise and chose Beto O’Rourke," the statement continued.

Reyes, in the final days of the race, became increasingly negative in response. His campaign aired an ad highlighting O'Rourke's arrest for driving while intoxicated in the 1990s, and he made several statements claiming his opponent was a closet Republican.

Reyes "did try to put forth a pretty nasty ad of his own," said Rocha. But voters weren't buying it: "It was pretty bombastic. Pretty much on O'Rourke's character, with not much link to public policy."

This article has been updated to include the latest results.

Below, where you can find legalized medical marijuana in the United States:

Loading Slideshow...
  • Alaska

    Legalized for medical use. <a href="http://www.flickr.com/photos/alanasise/6847095796/" target="_hplink">Flickr: alana sise</a>

  • Arizona

    Legalized for medical use. <a href="http://www.flickr.com/photos/billward/110338154/" target="_hplink">Flickr: Bill Ward's Brickpile</a>

  • California

    Legalized for medical use. <a href="http://www.flickr.com/photos/gerbache/2260207829/" target="_hplink">Flickr: gerbache</a>

  • Colorado

    Also legalized possession by non-medical users. <a href="http://www.flickr.com/photos/dok1/520845832/" target="_hplink">Flickr: dok1</a>

  • Connecticut

    Legalized for medical use.

  • District Of Columbia

    Legalized for medical use. <a href="http://www.flickr.com/photos/bigberto/2770838680/" target="_hplink">Flickr: ~MVI~ (off to coron)</a>

  • Delaware

    Legalized for medical use. Flickr: <a href="http://www.flickr.com/photos/dougtone/7749689644/">Doug Kerr</a>

  • Hawaii

    Legalized for medical use. <a href="http://www.flickr.com/photos/ricardo_mangual/6006230817/" target="_hplink">Flickr: Ricymar Fine Art Photography</a>

  • Illinois

    Legalized for medical use.

  • Maine

    Legalized for medical use. <a href="www.flickr.com/photos/indywriter/2683524563/" target="_hplink">Flickr: indywriter</a>

  • Maryland

    Legalized for medical use.

  • Massachusetts

    Passed ballot initiative for legalized medical marijuana in 2012.

  • Michigan

    Legalized for medical use. <a href="http://www.flickr.com/photos/kayoticblue/213316452/" target="_hplink">Flickr: ckay</a>

  • Montana

    Legalized for medical use. <a href="http://www.flickr.com/photos/csbarnhill/2633187564/" target="_hplink">Flickr: csbarnhill</a>

  • Nevada

    Legalized for medical use. <a href="http://www.flickr.com/photos/http2007/4699361533/" target="_hplink">Flickr: http2007</a>

  • New Hampshire

    Legalized for medical use.

  • New Jersey

    Legalized for medical use. <a href="http://www.flickr.com/photos/paulflannery/4021996652/" target="_hplink">Flickr: psflannery</a>

  • New Mexico

    Legalized for medical use. <a href="http://www.flickr.com/photos/everyskyline/3134662783/" target="_hplink">Flickr: michaelwhitney</a>

  • Oregon

    Legalized for medical use. <a href="http://www.flickr.com/photos/d-powell/2099638403/" target="_hplink">Flickr: digging90650</a>

  • Rhode Island

    Legalized for medical use. Also decriminalized possession of less than one ounce.

  • Vermont

    Legalized for medical use. <a href="http://www.flickr.com/photos/bryanalexander/6129117/" target="_hplink">Flickr: BryanAlexander</a>

  • Washington

    Legalized for medical use. Also legalized possession by non-medical users. <a href="http://www.flickr.com/photos/rose_braverman/6924724331/sizes/l/in/photostream/" target="_hplink">Flickr: Rose Braverman</a>

Also on HuffPost: