The 23-year-old Brazil international has agreed what Liverpool describe as "a long-term contract" and will undergo a medical once he completes his commitments at the Copa America.
Firmino has scored 47 goals in 151 appearances during his four and a half years in Germany and has scored four times in nine international caps, including Sunday's Copa America winner against Venezuela.
Firmino is Liverpool's fifth signing in a busy start to the transfer window, with more expected to follow as strikers Carlos Bacca and Salomon Rondon are understood to be targets.
Manager Brendan Rodgers is keen to bring in another forward despite the arrival of England Under-21 international Danny Ings from Burnley, and the £32.5million release clause of Aston Villa's Christian Benteke is considered too high.
Therefore he has turned his attention to Bacca, the 28-year-old Colombian who scored 28 goals for Sevilla in Spain's Primera Division last season, and Rondon, a Venezuela international who has 20 goals in 39 matches for Zenit St Petersburg.
The pair are in Copa America action along with Firmino and the club feel they represent better value for money than Benteke, with reported fees of £20million and £15million respectively.
Liverpool have already recruited Ings, Manchester City midfielder James Milner, Charlton defender Joe Gomez and Bolton goalkeeper Adam Bogdan as well as giving a new long-term contract to Wales Under-21 goalkeeper Danny Ward.