By Liverpool correspondent Cam Downes

Liverpool have won the race to sign Hoffenheim playmaker Roberto Firmono, Football Insider sources understand.

The Merseysiders have beaten Manchester United and Manchester City to land the 23-year-old, who is starring for Brazil at the Copa America.

Liverpool have agreed a fee of £29million with Hoffenheim for Firmono, who is expected to sign a five-year contract with the Premier League club.

It will make the Brazilian the second most expensive signing in Liverpool’s history, following the £35million spent on Andy Carroll in January 2011.

Liverpool’s swoop for Firmono comes as City prepare to table a third formal bid for Raheem Sterling that could pave the way for the England international’s departure.

Sterling is believed to be keen to move to Etihad Stadium and City are willing to come close to matching Liverpool’s valuation to seal a transfer that is looking increasingly likely.

Like Sterling, Firmono is an attacking midfielder who can play in any of the third positions behind the centre-forward. He made 33 Bundesliga appearances last season, scoring seven goals and weighing in with 10 assists.