Google says tens of thousands of Gmail accounts belonging to Iranian users have been targeted in an extensive hacking campaign in the weeks leading up to the country's closely watched presidential elections.

The US Internet company made the announcement as the six presidential candidates wrapped up campaigning and Iranians prepare to vote on Friday to find a successor to President Mahmoud Ahmadinejad, who cannot run for a third term in office.

Google described the attacks as broad "email-based phishing" attempts seeking to trick unsuspecting Gmail users into giving up their user names and passwords.

They said they originated in Iran and appeared to be "politically motivated in connection with the Iranian presidential election on Friday".

Google said it has a policy to alert users to "state-sponsored attacks and other suspicious activity," but did not identify the perpetrators beyond saying that it appeared to be the same group behind a Gmail hacking campaign in 2011 involving fraudulent digital certificates.

The most recent phishing campaigns began almost three weeks ago, Google said. The "timing and targeting of the campaigns" suggested a connection to the election, Google said without elaborating.

Election run-up

Momentum has built for Muslim leader Hassan Rouhani after the withdrawal of reformist Mohammad Reza Aref, and the endorsement of two former presidents, pro-reform Mohammad Khatami and pragmatist Akbar Hashemi Rafsanjani.

Thanks to the support, Rouhani, 64, has emerged as one of the front-runners in the poll and has a real chance of forcing a run-off against the conservatives, analysts say.

The moderate-level leader, who was Iran's chief nuclear negotiator from 2003 until 2005, faces stiff competition in Friday's election from the conservatives, especially top nuclear negotiator Saeed Jalili, Tehran mayor Mohammad Baqer Qalibaf and ex-foreign minister Ali Akbar Velayati.

The three held separate campaign rallies in Tehran in the late afternoon on Wednesday, with none agreeing to step down to boost conservative chances.

According to an opinion poll published by Mehr news agency, Qalibaf was leading with 17.8 percent support from 10,000 voters canvassed, ahead of Rouhani with 14.6 percent.

Jalili followed with 9.8 percent.

The number of undecided voters in the survey stood at 30.5 percent -- translating to about 15 million voters - while 11.3 percent declined to answer.

Rouhani and Rafsanjani

The surge of support for Rouhani came after Aref, the only reformist candidate, announced on Tuesday he was withdrawing at the urging of Khatami.

The former president subsequently asked voters "who seek the dignity and elevation of the nation" to vote for Rouhani.

Rafsanjani, a pillar of the 1979 revolution who himself was barred from running, has also backed Rouhani, saying he was "more suitable" for Iran's highest elected office than the other candidates.

A Thursday report by the pro-reform Etemad newspaper quotes Rafsanjani as saying that people "should not boycott" the vote.

Many reform-minded Iranians say they will snub the election over crackdowns by Iranian authorities and the decision to keep former Rafsanjani from the ballot.

Rafsanjani's stature rose sharply with liberals after he criticised hardline tactics used in 2009 against protesters following the disputed re-election of Ahmadinejad.

The closing of reformist ranks behind Rouhani prompted the conservative camp on Wednesday to urge their candidates to coalesce.

Habibollah Asgaroladi, secretary-general of a leading umbrella organisation for conservative groups, said without elaborating that consultations were under way to make "a coalition happen".

But any behind the scenes talks appear to have failed.

Jalili's campaign manager, Ali Bagheri, said his candidate would remain in the race "until the end".

"Jalili will make it to the second round should there be one," Bagheri told the AFP news agency.

Velayati, at a separate meeting in central Tehran, also vowed not to drop his bid.

Campaigning

Wednesday was officially the last day of campaigning, but under Iran's electoral law, candidates and their supporters had until 0330 GMT on Thursday, 24 hours before the polls open, to wind up their campaigns.

This year's campaign has been low-key compared with 2009 when boisterous rallies and street parties attracted crowds, as supporters of pro-reform candidates Mir Hossein Mousavi and Mehdi Karroubi faced off against conservative-minded incumbent Ahmadinejad.

The rallies turned into heated street protests when Ahmadinejad was declared winner for a second term, leading his opponents to allege massive electoral fraud.

Months-long demonstrations that followed turned deadly and were eventually crushed by the security forces.

Mousavi and Karroubi were later placed under house arrest.

Some 50.5 million voters are eligible to vote for a successor to Ahmadinejad, under whose presidency Iran has been isolated internationally over its controversial nuclear drive.

Hooman Majd, Iranian-American journalist, author and commentator, told Al Jazeera that if the youth, who make up a big percentage of the population, show up to the polls, it could be significant.

He added that the likelihood is that a number of them probably will not vote due to disillusionment and apathy with the government. Majd said that the youth did show up in large numbers in the 2009 elections.

Supreme leader Ayatollah Ali Khamenei, who has the final say on all key state issues, including nuclear activities, has urged a high turnout on Friday.

"If I insist on a massive turnout, it is because it will discourage the enemies (forcing) them to reduce the pressure and choose another path," he said.