A month after taking office, President Felipe Calderon stood in military fatigues before a group of soldiers in western Mexico and pledged to put a stop to drug-related violence.
Turf wars between drug cartels were spreading deep into Mexico, beyond the smuggling hotspots on the U.S. border; extortion was a growing menace, and hitmen had resorted to new levels of brutality, dumping severed heads in public.
So Calderon said enough was enough.
We are determined to reestablish the security, not just of Michoacan or Baja California, but of all Mexico, which is being threatened by organized crime, he told the soldiers in Apatzingan, in his home state of Michoacan.
But since then, the drugs war has taken a much heavier toll, claiming more than 50,000 lives and blighting many more.
Calderon's decision to use the army to crush Mexico's drug gangs has dominated his presidency. It set off a spiral of violence that shook confidence in the security forces, and has hit support for his conservative National Action Party, or PAN.
Rather than handing on a safer Mexico to his successor, Calderon's offensive against the cartels has laid bare the limits of the state's power against organized crime.
As the campaign to pick a new president on July 1 formally begins on Friday, many fear the election will highlight the growing threat of the gangs.
Calderon, who cannot run for a second term, has hailed the capture or death of some senior drug traffickers but the menace of the cartels looms larger than ever in the Mexican public consciousness, and electoral authorities are offering unprecedented levels of protection for candidates.
In northern Mexico the situation is particularly acute, said Eduardo Arguijo, a senior official in the leftist opposition Party of the Democratic Revolution (PRD) in Nuevo Leon state.
In this area, things are in a really bad way, he said, referring to the northern part of the state. There are no mayors, there are no doctors in hospitals, there are no police because of it, because of the fear.
He said threats had already forced local PRD candidates to quit in some 20 municipalities in the area, which has been ravaged by one of Mexico's most brutal drug gangs, the Zetas.
There's no competition here, they (the gangs) are only letting one party in, he said, referring to the opposition Institutional Revolutionary Party (PRI), which ruled Mexico for most of the past century and is favoured to return to power.
Nevertheless, the impact of the cartels on the democratic process will likely be more subtle than that suggested by the piles of heads and mutilated corpses they have left behind them over the past five years.
This is because most drug traffickers do not want - or need - to be making international headlines, said George W. Grayson, a Mexico expert at the College of William & Mary in Virginia.
All narcotics is local, he said, borrowing from a phrase on politics coined by Tip O'Neill, the former speaker of the U.S. House of Representatives.
To keep supply routes under their control, traffickers are expected to focus on pressuring local officials rather than national power brokers who have few ties to their terrain.
A Reuters survey of 17 security experts and political analysts found that two thirds believed drug gangs were more likely to meddle in the electoral process or attack candidates than in 2006. None took the view that the risks had diminished.
Nearly all the experts felt that town mayors and regional politicians would bear the brunt of the threat in the many local, state and federal elections taking place in July.
In spite of tight security, the main leading presidential contenders are not expected to stray far from bigger towns and cities, especially in areas disputed by the rival gangs.
Enrique Pena Nieto of the PRI is hot favourite to win the presidency, and the party is taking his safety very seriously. When the PRI last won the presidency in 1994, a gunman shot dead its original candidate.
His nearest rival, the PAN's Josefina Vazquez Mota, has pledged to uphold Calderon's strategy on crime, presenting a possible target for gangs wanting to intimidate the government.
Only leftist candidate Andres Manuel Lopez Obrador, who narrowly lost the 2006 election to Calderon, has travelled to every corner of the country in his bid to win this year. But even his campaign this week alerted the government that candidates on its ticket have been threatened.
SURGING DEATH TOLL
Fear, bribes and a weak justice system have for years enabled drug cartels to go about their business in much of Mexico without major interference by authorities.
But in the months after Calderon's January 2007 speech in Apatzingan, gangland killings began to mount across the country.
His administration was sucked deeper into the conflict, hampering efforts to attack the poverty and corruption that crime feeds off in Mexico, and rattling investors and tourists.
According to government data, annual drug-related killings leapt from 2,826 in 2007 to 15,273 in 2010. Figures from the attorney general's office showed a further jump of 11 percent in the first nine months of 2011.
Even voters like Rogelio Villanueva, a 56-year-old Mexico City businessman who is backing Vazquez Mota, shake their heads when asked if the crackdown on the cartels has worked.
The cockroaches just flee in all directions, he said.
To ensure the July elections pass off smoothly, the federal election institute for the first time is offering protection for all contenders, not just presidential candidates.
But this is no guarantee of safety - or a fair contest.
Reports of interference by gangs were rife during Mexico's last regional elections in Michoacan in November. One sparked an investigation by the attorney general's office that a local drug cartel had pressured voters to back the PRI.
And just before polling day, a PAN town mayor was shot dead while campaigning, one of around 30 to have been murdered under Calderon. Despite this, the Michoacan attorney general's office said no formal complaints had been lodged about the drug gangs.
What interests them is not so much the electoral process, it's more buying politicians, said Raul Benitez, a security expert at Mexico's National Autonomous University. Some politicians do it for money, some out of fear.
U.S. court documents published last month said drug cartels paid $4.5 million in bribes between 1999 and 2005 to buy protection and political favours in the northern border state of Tamaulipas, implicating a former PRI governor. That investigation is continuing.
Horacio Rios, chairman in Michoacan of New Alliance - a smaller party whose candidate is fourth in the presidential race - said during the state elections there in November, gang members demanded protection money from members of his campaign team as they tried to reach voters in remote, rural areas.
We had helpers threatened. Organized crime people asked them for 200,000 or 300,000 pesos ($15,600-$23,500) to let them pass, said Rios.
The main parties have accused each other of complicity with drug traffickers, but few people come forward to present evidence, let alone the kind that leads to convictions.
Between late February and early March, Reuters submitted public information requests to electoral and prosecuting authorities in all of Mexico's 31 states, Mexico City and the federal government to determine how many complaints were filed against drug gangs trying to influence recent elections.
Most of the states had replied or acknowledged the requests, but none reported any such complaints.
Even in Tamaulipas, where gunmen murdered a PRI candidate for governor in 2010, electoral authorities said no claims of foul play by organized crime to do with the vote had been filed.
Failings in the justice system have prompted some Mexicans to try unmasking criminals using the internet as cover.
But that too comes with risks.
In September, the bloodied corpses of a man and a woman were hung from a bridge in northern Mexico after they posted online messages about drug gangs. Notes were found near to the bodies warning social media users to stay out of the gangs' business.
Even the police have been made examples of.
Earlier this month, gunmen ambushed a convoy of police officers investigating suspected gangland killings in Guerrero state, killing 12 and wounding 11 others.
They're impervious right now, Rodolfo de la Garza, a political scientist at Columbia University, said of the gangs. If they influence the outcome of the election, they get to do what they want. If they don't influence it, they get to do what they want. I don't think they believe anybody can beat them.
(Additional reporting by Miguel Gutierrez; Editing by Kieran Murray)