WASHINGTON -- In early 2009, El Paso Rep. Sylvestre Reyes (D) warned city council members that, if they approved a resolution calling for a debate on marijuana legalization, the city would jeopardize its federal funding.

Instead, what turned out to be at risk was Reyes' seat in the House of Representatives in 2012.

On Tuesday night, El Paso voters ousted Reyes in a Democratic primary, in favor of the council member who had pushed the 2009 legalization resolution, Beto O'Rourke.

Reyes, a former border control agent who was elected to Congress in 1996, had the backing of President Barack Obama and former President Bill Clinton. Reyes brought the popular Clinton to the district to campaign for him this year and dredged up his opponent's burglary and driving while intoxicated charges from the 1990s. It wasn't enough.

As the U.S.-backed drug war in Mexico has raged just across El Paso's border, Texas officials have struggled to cope with its consequences. O'Rourke, in 2009, successfully pushed a resolution through the city council that called on the federal government to consider legalization as one possible policy response to the spiraling violence.

President Obama, facing pressure from Latin American leaders, has said more recently that such a discussion is legitimate. But three years ago, even floating the notion was controversial. The mayor vetoed O'Rourke's resolution, and Reyes warned the council that, if it overrode the veto, federal funds would be at risk.

"All we're asking for is a conversation, and no important issue in the history of the United States -- social, criminal, legal or otherwise -- has ever been harmed by having an open discussion. That's all we're asking for today," said O'Rourke at the time.

City Rep. Emma Acosta said during debate on the veto override that she had finally been persuaded by the funding threat. "If we had voted yesterday, I would have voted in favor of it," she said in 2009.

Then-City Rep. Rachel Quintana, before switching her vote, explained that pressure from Reyes and the state legislators "absolutely pushed me over."

In switching their votes, other council members also cited the federal pressure.

Reyes acknowledged to HuffPost in 2009 that he was lobbying against the resolution.

"My concern always is, if we've got a negative connotation about things in my district," he said, then it makes getting federal dollars harder. He cited his long-running battle in Congress against the notion that El Paso was running out of water. Whenever he tried to get federal funds for El Paso's base, Fort Bliss, or other projects, his colleagues would raise the water issue. "Why invest government funds in facilities in an area that's going to run out of water?" he said they'd argue.

"So that's the concern. Any time you have negative perceptions, you open the door for others to use that as leverage to get more money in their districts and not in mine," he said. "I'm up here representing the district, and I can tell people, based on my experience, what helps me and what doesn't."

O'Rourke didn't give up the fight for legalization, instead challenging Reyes for his job in the 2012 primary. In April, he told HuffPost the drug war was a failure and is fueling the violence across the border.

Reyes tried to make it a campaign issue, telling voters to "Say NO to drugs. Say NO to Beto."

They said no to Reyes.

Below, where you can find legalized medical marijuana in America:

PHOTO GALLERY Legal Marijuana Across The U.S.