During his second exile, Mohammad Reza Pahlavi traveled from country to country seeking what he hoped would be temporary residence. First he flew to Assuan, Egypt, where he received a warm and gracious welcome from President Anwar El-Sadat. He later lived in Morocco as a guest of King Hassan II, as well as in the Bahamas, and in Cuernavaca, Mexico, near Mexico City, as a guest of José López Portillo. Richard Nixon, the former president, visited the Shah in summer 1979 in Mexico. The Shah suffered from gallstones that would require prompt surgery. He was offered treatment in Switzerland, but insisted on treatment in the United States.
On 22 October 1979, President Jimmy Carter reluctantly allowed the Shah into the United States to undergo surgical treatment at the New York–Weill Cornell Medical Hospital. While in Cornell Medical Center, Mohammad Reza Shah Pahlavi used the name "David D. Newsom", Under Secretary of State for Political Affairs that time, as his temporary code name, without Newsom's knowledge.
The Shah was taken later by U.S. Air Force jet to Kelly Air Force Base in Texas and from there to Wilford Hall Medical Center at Lackland Air Force Base. It was anticipated that his stay in the United States would be short; however, surgical complications ensued, which required six weeks of confinement in the hospital before he recovered. His prolonged stay in the United States was extremely unpopular with the revolutionary movement in Iran, which still resented the United States' overthrow of Prime Minister Mosaddegh and the years of support for the Shah's rule. The Iranian government demanded his return to Iran, but he stayed in the hospital