Huddled at a home in Ecuador's capital, President Lenin Moreno's aides anxiously awaited word in the middle of the night on an operation that would soon make headlines around the world: the arrest of WikiLeaks founder Julian Assange inside the country's London embassy.
Over the course of nearly seven years, the Australian hacker had all but worn out his welcome at the embassy with antics that included late-night skateboarding, harassing the staff and smearing his feces on the walls, according to Ecuadorian officials.
Moreno had finally decided to kick Assange out after getting wind of a WikiLeaks plot to blackmail him by publishing compromising documents, according to a senior government official who wasn't authorized to discuss the matter and spoke on condition of anonymity. An incensed Moreno gave British authorities 36 hours to execute the raid Assange's critics had long been demanding.
Now, the president's aides looked nervously at their watches. Most of Ecuador, including Moreno himself, was asleep. As Moreno's 4 a.m. deadline approached, they heard nothing.
"We were waiting and waiting and thought, 'Wow, something's wrong,'" said the official. "Then we got the call."
Assange had been dragged without incident from the embassy to face hacking charges in the U.S.
"We've ended the asylum of this spoiled brat," Moreno crowed later in the day Thursday in a fiery speech.
The move to extract one of the world's most high-profile fugitives came about relatively quickly after years of what officials portrayed as obnoxious and ungracious behavior by their houseguest.
Moreno, a 66-year-old who uses a wheelchair after being shot and paralyzed from the waist down in a 1998 robbery, is usually a jovial figure. But the still-under-investigation blackmail plot marked one more in a string of escalating personal attacks against him. Days before, Moreno had accused WikiLeaks of spreading damaging personal documents and photos, including several that showed him eating lobster in bed.
"The president is a very calm person," said the senior official, who was involved in the raid's coordination. "But when he gets angry he can be very determined."
Ecuador gave Assange asylum inside the embassy in 2012 to avoid extradition to Sweden over sex-crime accusations. On a summer day, Assange moved into the compound near London's upscale Harrods department store for what most thought would be a short stay.
Instead, the cramped quarters, where a small office was converted into a bedroom, became a permanent address. Some regarded it as essentially a jail.
Former President Rafael Correa, whose government granted Assange refuge, had been a fierce supporter of the silver-haired computer expert. Correa saw him as a digital-age Robin Hood taking on big government and corporations.
But Assange got off to a bad start with Moreno after he won the presidency in 2017, angering the chief of state with comments on Twitter ridiculing a losing candidate who had threatened to expel him.
Over the years, one high-ranking official said, Assange's room at the embassy had become a "sovereign territory within a sovereign territory" that none of the staff at No. 3 Hans Crescent could enter. Embassy staff complained he smelled bad from going weeks without a shower. He also played loud music at all hours, walked around in his underwear and verbally abused the staff, officials said.
Feeding and sheltering him cost an estimated $1 million a year, authorities said.
After making his decision Tuesday afternoon, Moreno ordered his top aides to coordinate with Britain's ambassador to Ecuador, Katherine Ward, to carry out a raid within 36 hours. While his British counterparts requested more time, Moreno insisted on executing Assange's expulsion swiftly. He didn't want word of the operation to leak or to rouse suspicions of U.S. involvement, the senior official said.
Before dawn Thursday, a group of five close aides to Moreno gathered at a Quito home to await word. The appointed hour came and went without any news.
Finally, shortly thereafter, Ecuador's ambassador to Britain, Jaime Marchan, called to say that Assange was in British custody. The aides quietly celebrated and then called to wake up the president.
According to the official, the operation went off without a hitch. The Ecuadorian ambassador asked Assange to come to his office, and Assange was read a government statement announcing his expulsion. Unarmed British police officers then hauled the bearded and shouting Assange out of the embassy.
At that point, WikiLeaks' editor-in-chief Kristinn Hrafnsson's cellphone rang. An aide to Assange who had witnessed the raid was calling to inform Hrafnsson.
"It's horrible news," Hrafnsson said later.
The only worry Ecuadorian officials had at the time of the raid was a vague threat by Assange several months earlier that he would activate a device that would cause major consequences to the embassy if they ever tried to expel him.
It was never clear if the device, described as a button, was real and capable of actual physical damage, or simply metaphorical. British intelligence was made aware of the threat and made sure Assange wasn't allowed to return to his room once the raid began.
In the U.S., the Justice Department promptly announced charges accusing Assange of conspiring with former Army intelligence analyst Chelsea Manning to hack into a Pentagon computer.
Assange's critics and authorities in Britain and the United States praised Moreno for a decision they said will ensure he is held accountable for both jumping bail in the sex-crime case and publishing a trove of confidential U.S. government documents.
Others, including Moreno's one-time ally, Correa, assailed him, saying that even though Assange may have violated the terms of his asylum and was a costly burden, "that's no excuse for throwing him to the lions."
Moreno stood firm.
"From now on we'll be more careful in giving asylum to people who are really worth it," he said. "And not miserable hackers whose only goal is to destabilize governments."
Associated Press writer Gregory Katz in London contributed to this report.