Bottas was quickest in all three practice sessions ahead of qualifying at Mugello, but Hamilton was able to raise his game when it counted to take his 69th pole for Mercedes, and 95th of his Formula 1 career.
"It's always incredibly hard to beat Valtteri," said Hamilton. "He is always consistently improving and pushing to the limit. Straight from the get-go he had the upper hand and it was difficult at the beginning to know where we stood.
"Valtteri was quicker all day yesterday, quicker this morning, quicker in Q1, and it was almost like nothing I did...I was making all these changes, I changed a lot in the set-up, and I just really studied, just making sure I improved in all the areas I was weak.
"I went out in Q1 and I was still not quick enough, but I love that challenge and I really enjoy the battle with Valtteri."
Hamilton, who took pole by just 0.059s from the Finn with a lap of one minute 15.144secs, added: "In Q2 I got quite a good lap, and In Q3 run one was quite decent, but there was still a little bit of time left on the table.
"I was hoping to get that for the last run but the wind picked up, I could feel it gustier down the straight up into turn one.
"The car was sliding around a lot more on that lap but I ended up being a bit down [on time]. Nevertheless I really, really enjoyed this qualifying today, this track is amazing."
This season's visit to Mugello is a first for F1, and the layout has been met with near unanimous approval from teams and drivers, leaving Hamilton to hope it is not the first and last time the sport visits the Tuscan track.
Hamilton said:: "Max [Verstappen] was just saying we should come here again, plus we're in Tuscany which is a beautiful place to be."
GPFans is a multi-platform, multi-language brand dedicated to Formula One coverage. We bring you all the ins and outs of the sport, 24/7, everything from up-to-the-minute news and features to the latest viral stories and clips.
We believe that a new generation of exciting, outspoken drivers will make F1 more popular than ever before, and we want to give our users access to as much of their heroes as possible, on and off the track. From Lewis Hamilton to Max Verstappen, Daniel Ricciardo to Sebastian Vettel, we provide in-depth analysis of every every Grand Prix in the season, from Australia to Abu Dhabi.
With Formula One under the new ownership of Liberty Media, how the sport is being covered is evolving, and GPFans will look to be at the heart of this progression into new media, as one of the fastest-growing sites covering the king of motorsports.