The 18-year-old Spaniard is enjoying a breakthrough season with Jurgen Klopp's side, making 10 appearances across all competitions this season.
Bajcetic scored his first goal for Liverpool in the Boxing Day victory at Aston Villa last year.
He joined the club from Celta Vigo in December 2020.
"Obviously I'm so, so happy, so excited to keep playing for this club and hopefully I can play more years together. Me and my family are very proud to sign a new contract with this club," Bajcetic told liverpoolfc.com.
"It feels amazing. It's something I've been dreaming of in these two years I've been here and something that I've been working hard [for] as well.
"It's crazy. A year ago I was playing U18s football and now I've started some games, made my debut and even scored a goal – that was something I never expected to happen this year. It's amazing to see how fast it went. But I keep working hard and hopefully [there are] more things to come."
Elaborating on his rapid rise to first-team football, Bajcetic added: "Last season when we were playing U18s, some games in the U21s, we knew some of the staff were watching the games, and I had some training that season with the first team.
"Obviously then I went to pre-season – me and my teammates – and that was the time we worked harder and we were close to the first team. I think that was the moment they chose me to stay.
"My target is to be a regular here at Liverpool and keep winning trophies with this club and achieving things collectively basically."
Bajcetic can add to his Liverpool appearances in the FA Cup encounter against Brighton and Hove Albion on Sunday.