The cramped rubber dinghy was drifting, directionless, with 53 migrants on board. The coast of Libya, from which the boat had set out, was 47 miles to the south and the nearest part of Europe was out of reach, about 140 miles north.
The boat was spotted shortly before 10:00 on 12 June by a French plane. The plane's crew of volunteers had been scouring the Mediterranean for people in distress, and they alerted another rescue team on board a nearby charity ship, the Sea-Watch 3.
The crew of the Sea-Watch 3 made their way towards the distressed dinghy and rescued those on board. At that point, the crew could have handed the migrants over to Libyan coastguards, but the Sea-Watch 3's captain, a 31-year-old German named Carola Rackete, did not consider that an option.
Libya has in recent years descended into a lawless, chaotic state policed by armed militias, and Sea-Watch, a German charity, had already vowed never to return migrants to its shores.
"Forcibly taking rescued people back to a war-torn country, having them imprisoned and tortured, is a crime that we will never commit," the charity said in a statement last month.
The next closest port to the Sea-Watch 3 was on the Italian island of Lampedusa, but the Italian government had banned rescue ships bearing migrants from docking at its ports. Rackete spent two weeks in international waters, before deciding on 29 June that the health of those on board was at risk.
Italy, where her human cargo was not welcome, was the only option.
The Italy Rackete headed towards aboard Sea-Watch 3 was not the Italy of mid-2015, when Europe's migrant crisis was at its height.
Of the more than a million migrants who fled into Europe that year, 154,000 arrived into Italy and the then-prime minister Matteo Renzi pleaded with other EU nations for support. The number of migrants reaching Italy's shores has drastically diminished - just 2,800 so far this year - and the country is now led by a right-wing populist coalition elected partly on an anti-migrant platform.
Italy's Interior Minister Matteo Salvini, the man nicknamed Il Capitano (The Captain) by his supporters, delivers live broadcasts on Facebook in which he thumbs his nose at the EU. Germany's Angela Merkel and France's Emmanuel Macron, the leaders he blames for ruining the union, are regular targets.
"Italy has stopped bowing its head to obey," he wrote on Twitter in August 2018, two months after taking office, and after ordering Italian ports to prevent rescue ships carrying migrants from docking. "This time there are those who say NO," he wrote.
The Italian government's position is that Libya's coastguard should take migrants back, and that rescue ships are acting as a taxi service that facilitate traffickers' work. Many Italians seem to agree. One study by the Pew Research Center in March found that 52% of Italians thought migrants were a burden on their country, and that the number of Italians who believed immigrants helped make their country stronger had dropped significantly in the past four years.
The number of migrants reaching Italy is now "minute", Christian Dustmann, director of the London-based Centre for Research and Analysis of Migration, told the BBC. "But the way the Italian government has reacted is very much to make migration the joker in the pack, with Salvini trying to cultivate this image of a guy sorting out a problem which he makes out to be much bigger than it is."
One well-known humanitarian ship, the Aquarius, was forced to end all its rescue operations last year, after it was stranded with more than 600 migrants on board and no port in which to dock, its licence withdrawn.
On 11 June, Italy's cabinet passed an emergency decree ruling that any vessel that sailed into Italian waters without permission would face a fine of up to €50,000 (£45,000; $56,000). It was the following day that Rackete received the distress call about the drifting migrant boat.
Thirteen migrants would be taken off Sea-Watch 3 for medical treatment over the following two weeks. But another 40 would remain on board until the end, along with the ship's 22 crew members, in worsening conditions in a heatwave.
"Matteo Salvini has made you his main enemy at the moment, how do you respond?" Rackete was asked in a video interview on board the ship on 28 June. Rackete, who has long dreadlocks, squinted in the Mediterranean sun. "To be honest, I haven't read the comments, I haven't had time," she said. "With more than 60 people to take care of, Mr Salvini needs to get in line."
If anyone was to ever defy Salvini, Carola Rackete was a good fit. Born in the German town of Preetz, near the Danish border, Rackete travelled the world as a child with her parents before settling in Hambühren, northern Germany. From there, she went to study at a polar research institute where she picked up the navigation skills she would later put to use in the Mediterranean.
Former colleagues speaking to the BBC described an earnest person with a keen sense of her role in a global society. One, Greenpeace operations campaign adviser Grant Oakes, said: "She is very globally aware and committed to her principles and her responsibilities in the global community. Very humble. Fun, hard-working."
In a varied career, Rackete has taken part in rescues off the Greek coast at the height of the migrant crisis, studied albatross nesting sites in the southern Atlantic, worked with Greenpeace clearing plastic from Scotland's west coast, and led expeditions to the Svalbard archipelago in the Arctic to educate visitors on how climate change was affecting the region's ecology.
In her first operation for Sea-Watch, she helped recover the bodies of 45 migrants who had drowned in a shipwreck in the Mediterranean, German broadcaster Deutsche-Welle reported.
"In this case, you had a symbolic figure in Carola," Christopher Hein, a professor of law and immigration policies at Rome's Luiss University, told the BBC. "She's young, brave, a woman - and German.
"Everybody in Italy is now speaking about her, either as a good friend or a bad friend of the people. On one hand, you have a man representing the vast majority of the Italian parliament. And on the other hand, you have a young woman who is dedicated to humanitarian activities."
Nando Sigona, an Italian professor specialising in migration and refugee issues at the University of Birmingham says Salvini "has been searching for a big moment to grab attention, to get to this point of attacking NGOs and humanitarian organisations". The Sea-Watch 3 presented jus such an opportunity, he said.
Those who know Rackete and followed the events on the Sea-Watch 3 told the BBC they were in no doubt how she would act under such a spotlight. She would respond according to her convictions, they said, having carefully considered what she thought was correct, legal and fair.
After more than two weeks in limbo, Rackete said conditions on board the Sea-Watch 3 were beginning to deteriorate and that some migrants had started to self-harm.
Rackete decided to guide the ship into port in the middle of the night on 29 June. In doing so, her ship trapped an Italian police patrol boat against the quay. Salvini called the move "an act of war", and accused Rackete of being a pirate, outlaw, and a "rich, white, German woman".
"She tried to sink a police launch with officers on board at night," he said. "They say 'we're saving lives', but they risked killing these human beings who were doing their job, it's clear from the videos."
Soon after Sea-Watch 3 arrived in Lampedusa, the migrants were taken off the ship, and Rackete was arrested and warned she could face 10 years in jail. She apologised and denied she had tried to ram the boat, blaming a positioning error while docking.
In the end, the judge sided with Rackete on Tuesday, and with her interpretation of maritime law: as the ship's captain, she had a duty to protect the lives of those on board. She was carrying out that duty, judge Alessandra Vella said, and had not endangered life in doing so.
As she left house arrest, opponents gathered outside. One held a placard that read: "Salvini, our only captain."
Rackete is believed to have received threats and has been moved to a safe location. While Salvini has insisted she must leave Italy, she is not thought to have done so.
The case, thanks to the two people at its core, has highlighted a rising polarisation of opinion, Prof Hein of Rome's Luiss University, says. "There are splits in Italian society," he said. "It did not start with Sea-Watch 3. But it has become much more evident and harsh."
According to Nando Sigona, "the middle ground has been almost completely lost in this conversation".
The Italian government insists that what happened was an attack on the country's sovereignty. And in recent days, Salvini has fought back against the captain, judge Alessandra Vella and the critics of his handling of the situation within the French and German governments.
Sea-Watch has benefited from a build-up of support in Italy and outside. Two online campaigns have raised close to €1.4 million (£1.3m, $1.6m) between them over the past week. The court ruling, a Sea-Watch spokesman said, "re-establishes the dignity" of Italy.
With ships still rescuing migrants in distress in the Mediterranean, the test of whether that court ruling acts as a legal precedent may come sooner rather than later.