The pizzas arrived close to 10pm and the paperwork even closer to midnight. By then Pierre-Emerick Aubameyang had been at Barcelona’s Sant Joan Despí training ground for half an hour and in the city almost all day. He had come ready to sign an 18-month contract having done everything he could to bring them all to this point, reviving the move and maybe his career too, providing an unexpected solution to the club’s desperate search for a striker. But there was still a little longer to wait.Before he could become a Barcelona player, Aubameyang had to formally become no one’s player. In the end, this wasn’t a deal between them and Arsenal but between him and Arsenal. When the documents arrived confirming his status as a free agent having waived his claim to £300,000 a week for the next 18 months plus a payoff, then and only then could he sign. They got there just in time, at the close of a tense, dramatic day: just one minute before deadline, the president Joan Laporta said.It was approaching 1am, the winter window closed, when Aubameyang flashed a thumbs-up from the walkway along the top of the building. It wasn’t official, and still wouldn’t be the following evening, but it was done. Looking up at him were reporters and TV cameras. They had been out there all day, watching people come and go, able to make out movement and faces behind the glass, meetings going on. At one point, up in the offices, someone suggested pulling blinds down, but it was a bit late for that. Besides, this wasn’t something to hide: being seen probably did them more good than harm.Getting this done, finding a solution like this in circumstances like these, was reason for satisfaction. Earlier in the evening Laporta had turned up at a gala in the city with the deal looking like it wouldn’t happen. But after a few hours, word reached him from the director of football, Mateu Alemany, that the situation was more optimistic. “Mateu tells me that it looks like we can do this,” he announced. “He’s working miracles.” The following morning, Laporta was talking about a “titanic effort”.With Barcelona’s salary limit set at €97m and their actual salary mass over €400m, allowing the club to only invest one euro for every four saved, there was a tiny margin to register players – a situation made more complex because they still had Ousmane Dembélé. “We proposed exits, an English club included, but he [Dembélé] didn’t want them,” Laporta said. “It’s difficult to understand his position.” Dembélé’s refusal to cede to what he called “blackmail” removed Barcelona’s best means to loosen the grip of the salary limit. But they have still signed Dani Alves, Ferran Torres, Adama Traoré and now Aubameyang.Barcelona were unsuccessful in their attempts to move on forward Ousmane Dembélé. Photograph: Pedro Salado/Quality Sport Images/Getty ImagesIt has not been perfect, and at times it has felt chaotic, but given the position Barcelona had been in they are entitled to consider the window a significant success. There had been imagination and improvisation, mid-, short- and ultra-short-term planning running parallel. Some of what Barcelona ultimately did hadn’t really been planned at all, not at first. Some problems were resolved, others postponed. Others were potentially created for later or couldn’t be fixed yet. Solutions of sorts, though, had been found.Attention had turned to Aubameyang given the difficulties in closing a deal for Álvaro Morata, an idea for a backup plan forming while Barça were at the Spanish Super Cup, early discussions under way between Alemany, Aubameyang’s agent Kwaku Mensah and the Spanish agent, Eugenio Botas, with whom he is close. With the player ostracised in London, they thought perhaps there could be an opening. Xavi was keen. Arsenal welcomed the possibility of a departure for a player Mikel Arteta had frozen out, which isn’t the same as saying it would get done.According to Laporta, Barcelona have saved €159m on salaries and Philippe Coutinho’s move to Aston Villa gave them room for manoeuvre, but not much: the assumption remained that to complete any deal within La Liga’s limits, Dembélé would almost certainly have to depart. Attempts to make that happen continued to the end but failed, and when Aubameyang flew to Spain on Monday there was no deal. He did so alone and semi-officially, family in Sitges providing an excuse for the excursion – a risk Barcelona appreciated but still no guarantee.By mid-afternoon, it appeared there would not be a deal: a 5pm hospital slot to conduct a medical was missed. A six-month loan, Barcelona’s initial intention, could not be closed because of differences the clubs had over payment of the 32-year-old’s wages, which the Catalan club couldn’t afford. Arsenal, meanwhile, were reluctant to be put in a position where a problem could simply come back in the summer. An alternative was to become a free agent and leave Arsenal entirely. That was too great a risk in return for just six months, so Barcelona’s commitment had to be lengthened and structured differently.Reaching an agreement to rescind wasn’t simple, either. Optimism, like money, was in in short supply to start with, a belief growing that this just wasn’t going to happen now with time running out. But conversations continued, a lawyer called Iñigo Landa playing a key role, as did Iñaki Ibáñez, who ironically had last been at Sant Joan Despí when he negotiated the settlement for his client Ernesto Valverde, sacked in January 2020. Ibáñez is trusted by Alemany and Arteta and was called in to break the deadlock, to change the focus. Something had to give, someone had to give. It was time to let go a little.In the end everyone did, and everyone won on some level or another. Aubameyang especially: there were other options, but he personally pushed for Barcelona to be the solution, and moved further than anyone. Arsenal had made nothing, got no sale, but let go of a problem permanently and rid themselves of a total commitment not far off £25m, with the London club confirming Aubameyang’s departure via a message posted on their official Twitter account on Tuesday evening. “Thank you for everything, @Auba,” it read.At the end of the afternoon training session, Xavi emerged to ask about progress, happy to be told that they hoped this would happen. Around 8pm a deal was taking shape, pizza deliveries sustaining them as they worked. By 10pm, Aubameyang was at the hospital undergoing the medical.Actually, two deals had taken shape. An old contract terminated with one club, a new contract drawn up with another. There were also two draft versions of the latter: one if Dembélé went, one if he stayed, deals dependent upon what the regulations would allow Barcelona to spend. But a signing not dependent, not any more, on whether Dembélé departed. This would happen either way. Ultimately, there was a simple question and a simple answer, posed and resolved by the player. What’s the limit? And: that’s the salary, then.The Fiver: sign up and get our daily football email.There was no other way and the bottom line was that everyone wanted this. Barcelona had taken guidance from the league, although they await final registration; this was their last signing and they could use everything left within their limit but not a cent more. Aubameyang will earn around €2.5m. That is, for the first six months. Conversations took place about a change, a new deal in the second season, when salary limits will be set again – higher than now – and at which point the club hope to have made further sales and savings. Then, if all goes well, the anticipation is that the player’s salary will increase, some of what is “lost” now made up in the back end of the deal.Xavi has a striker, the 10th forward at the club. As a free agent, he didn’t even need to be registered before the deadline, he just needed to be released. And with a minute to go until midnight, nerves frayed and the pizza finished ages ago, at last he was. No longer an Arsenal player, Pierre-Emerick Aubameyang was free to sign for FC Barcelona.