An imperfectly charged battery hindered the start of Lewis Hamilton's Spanish Grand Prix qualifying session, but he believes Mercedes Formula 1 teammate Valtteri Bottas was faster when it mattered.

Mercedes team principal Toto Wolff said Hamilton's battery could not be charged properly between the second and third parts of qualifying, which meant he was sent out earlier than planned.

Wolff told Sky Sports F1 that put Hamilton "on the wrong foot" because he was at the head of the pack and therefore caught cars going slowly, preparing on their out-laps, when he was on his flying lap.

Hamilton said that was a setback that contributed to a session that "ultimately just wasn't a good enough job".

"Valtteri did a fantastic job, he has been quick all weekend," said Hamilton. "On my side I jut didn't put the laps together, so the last couple of laps, in Q3 particularly, weren't strong."

He added: "They just weren't very good laps. Valtteri was just quicker today, so he deserves the pole."

Hamilton was left trailing Bottas by 0.634s, but did manage to complete another Mercedes front-row lockout.

Despite his issues, the five-time world champion ended the session two tenths clear of the lead Ferrari of Sebastian Vettel.

Bottas said his "big" gap to Hamilton was unexpected, and when asked by about the advantage over Ferrari both Mercedes drivers admitted it came as a surprise.

"I have to say when I saw the times, definitely we expected Ferrari to be closer," said Bottas. "Also everything based on winter testing, this seemed to be a track that really suits them.

"But since practice yesterday we have been in good form. We've been doing a good job with the team in terms of the direction we are taking the car to, in terms of where to find the performance. We have done a really good job with that and we are all impressed."