The Reds had agreed to sign the 19-year-old late on in the January transfer window, only to fail to get a deal over the line in time on deadline day.
However, Jurgen Klopp remained interested in the midfielder and was keen to secure his signature before his Fulham contract expires this summer, when he would have become a free agent.
The two clubs have now agreed a deal worth an initial £5million, with a further £2.2m in potential add-ons. Carvalho is following the same route taken from Craven Cottage to Anfield by another academy graduate, Harvey Elliott, three years ago.
Carvalho was one of the stars of Marco Silva’s Championship-winning side, scoring 10 goals and registering eight assists in 36 league appearances as the dominant Cottagers secured an immediate top-flight return in emphatic style.
Born in Lisbon, Carvalho was on Benfica’s books before moving to London in 2013 and had presented England at youth level, but switched allegiance to Portugal’s Under-21s in March. He is yet to make any public commitment over his senior international future.