No fee was disclosed, but British media reports said the 21-year-old Portuguese forward would initially cost the Bees £22.5 million ($28.7 million, 26.3 million euros), with a further £5 million in add-ons.
Liverpool would also be entitled to a 17.5 percent sell-on fee for a player they bought from Fulham, another of the London clubs in the Premier League, for £5 million two years ago.
Carvalho’s contract also includes an additional one-year extension option.
“Fabio is a player with a lot of qualities,” Brentford boss Thomas Frank told the club’s website.
The Dane added: “He can play in all of the front three or four positions in a 4-3-3 or a 4-2-3-1. His best position is probably as a number 10 or coming in from the left.”
“Offensively, he has great abilities on the ball: he can go past players, slide a pass, create chances and get on the end of chances. He’s a type of player that we don’t have many of in the squad so he will add that something extra for us.
“His ability and mentality to work hard in the pressure is also very, very good.
“That’s along with him ticking all the boxes from a cultural perspective and being the right character. So we’re very pleased to see him come in and push the team forward.”
Carvalho spent last season on loan at German club RB Leipzig and then for English second-tier side Hull, where he scored nine goals in 20 appearances.
Brentford, who finished 13 points above the relegation zone last season, begin the new Premier League campaign at home to London rivals Crystal Palace on Sunday.
© Agence France-Presse
Photo: ProShots/Icon Sport via Getty Images