A bomb has exploded in the north-east Afghan city of Feyzabad, targeting interim President Hamid Karzai's running mate, Afghan officials said.
Two people were killed in the explosion. However, Mr Karzai's vice-presidential candidate, Ahmed Zia Masood, was not injured.
The incident came as Mr Karzai held his final rally ahead of Saturday's vote.
Mr Karzai received a late boost on Wednesday as two candidates said they would now support him.
Afghanistan's former Taleban rulers say they carried out the attack in Feyzabad.
"It was a remote-controlled bomb planted on a roadside. But Masood's car missed it because it went off late," senior Taleban commander Mullah Dadullah told Reuters.
The Taleban and al-Qaeda have vowed to disrupt the presidential elections.
Ahmed Zia Masood escaped unhurt from Wednesday's blast
The BBC's Crispin Thorold in Kabul says the province of Badakhshan, where the blast took place, is not an area where there has been much militant activity.
Interior ministry spokesman, Lutfullah Mashal said: "The investigation is going on. It is the work of the enemies of peace and the elements who want to derail the election process."
Mutaleb Beg, a local police official, told the Associated Press agency four people were hurt in the blast.
Reports said the former governor of the province, Sayed Ikramuddin, was one of those hurt.
Mr Masood is the brother of the late Ahmed Shah Masood, who led the battle against Soviet occupation.
President Karzai held his final rally on Wednesday in front of thousands of supporters in Kabul's sports stadium.
He also received a boost when two presidential candidates, the influential Pashtun figure, Sayed Ishaq Gailani, and Asif Aryan, said they would now support him.
Their names will remain on the ballot and correspondents say it is unclear how it will affect the vote.
Mr Karzai told the crowd in Kabul: "By voting you are laying the first bricks in a wall of democracy that will last for decades
The rally was only the second public meeting Mr Karzai has held.
The first was on Tuesday when he flew by helicopter to Ghazni, 100km south of Kabul, to speak to about 10,000 people.
Under Afghan electoral law, campaigning ends on Wednesday.
Around 6,000 people packed into Kabul's stadium - which was notorious under the Taleban regime for public executions.
The BBC's Crispin Thorold, at the rally, says there was a festive atmosphere with men performing the national dance to the accompaniment of drums.
Supporters held banners saying "a vote for Hamid Karzai is a vote for democracy".
Mr Karzai said Afghans should cast their ballots freely, without pressure from anyone, including his own officials.
"We have 18 candidates and it is a source of pride that after three decades of war, interference, bloodshed and destruction... we proved that we are a noble nation."
Mr Karzai's rally was followed at the same venue later in the day by one for Uzbek General Abdul Rashid Dostum.
He told a crowd of around 1,000: "Firstly I tell you that we will win. If not, the future government without us would have no legitimacy."
Our correspondent says the campaign is drawing to a close just hours after it sprang into life.
For nearly four weeks the candidates' posters, pasted to walls across the country, were the only sign that a democratic ballot was imminent.
Although the other leading contenders, including the former education minister, Yunis Qanuni, have been more active, this is an election that is likely to be won behind closed doors, our correspondent says.