Let's try and make some trouble for Ferrari - Hamilton
Lewis Hamilton insists Mercedes have a "bit more ground to make up yet" on Ferrari, but was pleased with an improved performance in qualifying for the Azerbaijan Grand Prix.
Sebastian Vettel will start at the head of the grid for Sunday's race in Baku after the German driver claimed his third successive pole position this season.
However, Hamilton was not far behind the championship leader, showing excellent speed around the city circuit to suggest he is returning to form.
The Brit has not won a race since last year's United States Grand Prix but praised Mercedes for making improvements to his car following a disappointing performance in practice.
"We weren't quite quick enough today to beat Ferrari today, but it was super close," an upbeat Hamilton said.
"No athlete can be satisfied with second, but it's nice to be back up on the front row after an exciting session. The team did a great job overnight to make a step forward after what was a tricky Friday.
"On our long runs we've been down, losing out in the middle sector, and the Ferraris have been quite a bit quicker than us, so we've still got a bit more ground to make up yet, but it's great to be there in the fight.
"We worked hard to get the car in a better place, so we need to maximise the result now tomorrow.
"Let's try and make some trouble for Ferrari. It's definitely going to be another interesting race."
Hamilton finished ahead of team-mate Valtteri Bottas, putting the two Mercedes drivers in striking distance of Vettel.
The Finnish driver believes conditions - with the weather forecast suggesting it will be windy during the race - could play a part in deciding the outcome.
"For the race, we're in a good position as a team," Bottas said. "Having both cars next to each other for the race start gives us a few opportunities and we can play with tactics.
"It's difficult to say how the wind tomorrow is going to affect the race, especially with all the buildings around. It should be an interesting race."