Wikileaks founder Julian Assange has said he may remain in the Ecuadorean embassy in London for up to a year - but even that would leave him far short of the record holder, a Hungarian cardinal who spent 15 years in the US embassy in Budapest.
The Cold War drama began in the cold pre-dawn of 4 November 1956. An anti-communist uprising was under way, but the head of the Catholic Church in Hungary, Cardinal Jozsef Mindszenty, had just learned of the arrival of Soviet troops in the city to put it down. He faced a stark choice - flight or arrest.
Imprisoned by the pro-Nazi authorities during World War II, Cardinal Mindszenty had then become an outspoken critic of the post-war communist government. As a result, he had spent eight years in prison on treason charges. He had been freed only a few days earlier by the anti-government forces involved in the uprising.
He decided to flee.
Not far away, at the American legation, Sgt Gerald Bolick, a US Marine guard, was finishing his morning rounds when he looked out of the window and saw four people approaching: two in army uniforms and two in clerical black. "I saw that one was Cardinal Mindszenty," he says.
"I ran up to talk to my detachment commander, and said 'The cardinal's on his way to our legation, what should I do?' He said, "Do your duty.' So I did an about-face, ran back down the stairwell, and opened up the door."
At around the same time, Bolick says, the legation received a coded message from Washington: "'If the cardinal shows up, give him shelter' was the gist."
But for Bolick and the small team of US Marines responsible for protecting the legation, there was a new problem.
"The Soviets had taken over Magyar radio. They broadcast that they were going to come to our legation and take the cardinal away. And that would happen at high noon."
So inside the legation, Bolick and the other marines prepared for an assault, gathering what weapons they could.
"We were not going to hand him over without a fight," he says.
"Whoever thought of taking the cardinal out of the legation must have been a doofus."
After a few tense hours, it became clear the Soviets were not going to storm the embassy. But the uprising was successfully put down. The communists backed by the Soviet Union regained power and thousands were imprisoned.
Inside the legation, the cardinal was given the chief of mission's office. It consisted of two rooms, one large, one small, and had its own little bathroom. The legation itself was a five-storey, terraced mansion on the corner of a boulevard in the centre of Budapest.
Cardinal Mindszenty settled into a routine, which included a daily walk in the embassy's small courtyard while the guards kept watch for snipers. The courtyard was enclosed on three sides by buildings which were often used by Hungarian state security.
Fourteen years after the cardinal took up residence, when a young American diplomat William S Shepard arrived to take up his post, the routine had not changed, though the cardinal had, by then, learned to speak English.
During his first walk in the courtyard with the cardinal, Shepard discovered that the security police had not forgotten the dissident priest.
"I went out with him and all sorts of windows opened. It was in the evening, and there were flashbulbs all over the place. I said, 'What on earth is going on?'
"He said, 'Those are the Communist photographers - the AVO (secret police) - they are taking your picture. ...You are supposed to be intimidated.'"
Shepard met the cardinal regularly.
"He was never intrusive. I would look up and see him at my office from time to time. I would obviously rise and ask if he wanted to talk a bit," he recalls. "But most of the time he spent actually in his office, and a particular fixation of his was writing his memoirs."
The cardinal did occasionally relax. "I'm not sure if he had a TV, but I do know that occasionally the cardinal would watch films because it was legendary how he detested the film that was a fictional version of his own situation. He just didn't like it."
The political climate slowly improved in the years after 1956. Many of those imprisoned were freed. Having debated the "case of Hungary" for several years, in 1963 the United Nations formally accepted the credentials of the new government.
But getting Cardinal Mindszenty out of the embassy remained a problem. Since his arrival, the cardinal had been caught in the middle of a Cold War stand-off - involving the Hungarian government, the Soviet Union, the United States and the Vatican. He himself was reluctant to compromise while the communists remained in power.
"From his standpoint, things were rather rigid, in the sense of, 'We are not free now, we should be - why negotiate with these people?'" says Shepard. On rare occasions the cardinal did show his frustration.
"I remember one day after a service in the legation, he said to no-one at all, 'What am I doing here, there are so many people to help. What am I doing here?'"
Others were wondering the same thing. By 1971 the Vatican was keen to improve its relations with the Hungarian authorities. With US support a deal was done, despite some resistance from the cardinal. He was to leave the embassy and the country on 28 September 1971.
His departure was a secret. There was to be no crowd to see him leave. The road around the embassy had been sealed off. The park opposite was deserted.
But Shepard's wife Lois was determined that someone should bear witness to the cardinal's first steps outside the embassy in 15 years.
"The door opened, and I can picture it to this day.
"He stood there in his grand red robes and he gave a wide wave as though to multitudes.
"I was standing beside my car and waved back and smiled. And he smiled at me, he saw me. And he got into the car, they pulled the black curtains across the back of the windows and off they went."
The cardinal was flown to Rome. He went on to publish the memoirs he'd been writing inside the embassy. When he refused to retire as primate of Hungary, the Vatican stripped him of his title.
He died in exile in Vienna in 1975 at the age of 83. Inside the US embassy in Budapest, there hangs a plaque to commemorate the guest who stayed for 15 years.