Press Association Sport understands the Reds will pay 30million euros (about £22million) for the Hoffenheim player with add-ons likely to make the 23-year-old the club's second most expensive signing in their history, after the £35million purchase of Andy Carroll in January 2011.
Firmino, who will undergo a medical after his involvement in the Copa America is over, has agreed a five-year contract with the Reds after chief executive Ian Ayre flew out to Chile on Wednesday and the deal was finalised overnight.
The money for Firmino was outlined as planned summer transfer spending and the club do not have to sell Sterling, for whom Manchester City's second £40million offer was rejected earlier this month as they value him at £50million-plus, in order to balance the books.
They still have funds left for another centre-forward, with their sights set on Sevilla's £20million-rated Colombia striker Carlos Bacca and Zenit St Petersburg's Venezuelan Salomon Rondon, valued about £15million, who have both been in action at the Copa America.
Ayre is scheduled to remain in Chile for at least another 24 hours but Liverpool already had staff present at the tournament and they still retain interest in the South Americans after refusing to consider Aston Villa's £32.5million release clause for Christian Benteke.
Liverpool are also remaining patient in their pursuit of Southampton's England right-back Nathaniel Clyne, having already had a £10million bid turned down, as the recruitment programme aimed at regaining Champions League football continues.
Firmino is Liverpool's fifth signing of the close-season having already recruited Burnley's England Under-21 striker Danny Ings, Manchester City midfielder James Milner, Charlton defender Joe Gomez and Bolton goalkeeper Adam Bogdan.
The Brazilian spent four and a half years in Germany, scoring 47 goals in 151 appearances with four goals in nine internationals, including Sunday's Copa America winner against Venezuela.
Manager Brendan Rodgers will hope Firmino, who made his professional debut for Figueirense at the age of 17 in October 2009 but left for Germany just over a year later, can bring more goals to his side.
Main striker Daniel Sturridge was injured for most of last season and so their top scorer with 13 was Steven Gerrard, who has now left to join Major League Soccer side Los Angeles Galaxy, with Sterling next-best on 11.