Barcelona confirmed a deal to sign Malcom from Bordeaux on Tuesday, dramatically hijacking the Brazilian forward's move to Roma at the 11th hour.
Roma had announced on Monday that they had reached an agreement with Bordeaux to sign the 21-year-old.
But Barcelona made a late offer anyway and on Tuesday announced they had agreed terms to land Malcom from Bordeaux in a deal worth an initial €41 million, with an additional €1m potentially due in add-ons.
Malcom agreed a five-year deal to move to the Camp Nou, with a release clause expected to be fixed at €400m.
Roma supporters had even gathered at the airport in Italy's capital city to greet Malcom on Monday night, but he never arrived. Instead, terms were being negotiated with Barca, who had gazumped Roma's bid, which was reported to have been in the region of €32m.
👋 🇧🇷 Bem-vindo Malcom! Welcome!— FC Barcelona (@FCBarcelona) July 24, 2018
🔵🔴 #EnjoyBarça pic.twitter.com/nnxVK3hZt4
Fernando Garcia, Malcom's agent, met with the Catalan club to thrash out the final details as the contracts were quickly drawn up ahead of Tuesday's announcement.
Roma's sporting director Monchi said his club would examine their legal options, though he admitted the final paperwork of a deal was not signed.
"It was done. So I was very surprised when one of the representatives of the player called me to tell me that Bordeaux had withdrawn permission for the player to travel to Rome," Monchi told Roma's website.
"I called [Bordeaux president Stephane] Martin, and he told me that an offer had come in from Barcelona that was better than ours and that if we did not raise our offer we could not have the player."
Monchi said Roma then submitted a new offer to top Barcelona's that Bordeaux were willing to accept, but "Barcelona were still pushing for a deal," at which point Roma dropped out of the bidding.
Malcom will undergo a medical in Barcelona on Wednesday ahead of his presentation before flying out to the United States to join up with his new teammates.
Barca face Tottenham in Los Angeles on Saturday in the International Champions Cup, when Malcom could make his debut for his new club. However, if he's not included in the squad for that game, he could, coincidentally, come into the reckoning for the Blaugrana's match against Roma in Dallas next week.
It would add even more intrigue to the fixture at the AT&T Stadium, given Barca will already have one eye on avenging last season's shock Champions League exit at the hands of the Serie A side.
Malcom first arrived in Europe in 2016, joining Bordeaux from Corinthians, where he won the Brazilian title, and made almost 100 appearances for the Ligue 1 club.
He can play through the middle but is primarily a winger and he scored 12 goals last season to help Bordeaux to a sixth-placed finish, drawing attention from a number of European sides.
Borussia Dortmund and several Premier League teams were linked, but it was Roma's sporting director Monchi who looked to have sealed a deal to sign the talented attacker.
However, Barca arrived at the last minute to steal Malcom away from Roma and Monchi, who has turned down the chance to head up transfer operations at Camp Nou on several occasions in the past.