Bamford had one year remaining on his previous contract at Elland Road and had started courting interest from some Premier League rivals.
The former England u-21 international has made 111 appearances for Leeds United, scoring 43 goals since joining from Middlesbrough in the summer of 2018.
Bamford scored 16 goals in 45 championship games as Marcelo Bielsa’s men secured promotion to the Premier League in the 2019/2020 season and followed that up with another 17 strikes in the top flight last term to help Leeds finish 9th on the league log.
The former Chelsea striker has set his sights on helping Leeds secure European football next season as well as breaking into Gareth Southgate’s England squad after signing his new contract.
Reflecting on his new deal, Bamford told LUTV: "It was something that was spoken about at the end of last season, I wanted to try and get it sorted as soon as possible before this season started.
"It dragged on a bit because of the Euros, everyone was busy. It took a bit of time but I'm really happy to finally have tied down my long-term future.
"As a person, I'm always wanting to improve and am always chasing something else. It's almost like we're growing at the same rate. The club wants to get back to where it was, hopefully reaching Europe at some point, but that's my ambition as well.”
"So while they are matching, it is obviously perfectly suited."
The 27-year-old added: "I always set myself targets and there are things that I would like to achieve before leaving football. And they [European football and an England call-up] are two of them.
"But the main thing is to keep pushing on and being ambitious and seeing how far we can get in terms of a team and individually."