Less than two months before the assassination of President John F. Kennedy, Lee Harvey Oswald sat in a consular office at the Soviet Embassy in Mexico City, pleading desperately for a visa to return to Russia and tearfully claiming persecution by the FBI.

"I am afraid . . . they'll kill me. Let me in!" he sobbed, and with that pulled a revolver out of his jacket, according to an inside account of Oswald's perplexing visit to Mexico 30 years ago by the KGB officers who dealt with him.

Their story is contained in a new book, "Passport to Assassination," that, along with interviews and newly released U.S. government documents, draws a much fuller picture of Oswald and what may have driven him to shoot the president of the United States.

The Soviet portrayal of Oswald as a nervous, agitated man obsessed by what he regarded as the FBI's invasion of his life reinforces the possibility that Oswald was on the edge of violence unless he could escape from the United States, particularly from the bureau. He had been disenchanted with life in the Soviet Union and left. Now he was disenchanted again.

In late September 1963, while his pregnant wife and first child went off to live with friends in a Dallas suburb, Oswald traveled from New Orleans to Mexico City to try to get a transit visa to Cuba with the Soviet Union as his final destination. But he was told at the Cuban Consulate on Sept. 27 that the Cubans would not let him travel to Havana unless he first obtained a visa to continue to Russia.

At the Soviet Embassy that afternoon, Oswald met with a consular official named Valeriy Kostikov, in reality a Soviet KGB officer whose specialties included assassination.

One of the first things Kostikov recalled of this initial meeting was that Oswald said "he lived for a while in the Soviet Union" and kept repeating that "the FBI is after him." Late for a luncheon date, Kostikov turned the visitor over to another KGB officer on consular duty, Oleg Nechiporenko, author of the book.

When Nechiporenko told Oswald that he could only get a visa in Washington in a process that would entail a four-month wait, Oswald shouted, "This won't do for me! This is not my case! For me, it's all going to end in tragedy," Nechiporenko said.

At that point, Nechiporenko, who was head of foreign counterintelligence at the embassy's KGB station, said he decided Oswald was not worth further attention. "{He} did not have any interest for us," Nechiporenko wrote. "It was perfectly clear that our own internal counterintelligence back home had already studied him. Now that he was under FBI surveillance, let him be their headache, I thought."

Oswald had not given up yet. He went back to the Cuban Consulate where he claimed to have gotten a Soviet visa and now wanted a transit visa to Havana. The employee he spoke with, Silvia Duran, called to double-check. Kostikov told her the Soviets had promised Oswald nothing.

The upshot was another shouting match, this time between Oswald and Cuban consul Eusebio Azcue. Duran told Mexican police after the assassination that Azcue informed Oswald that people like him "were doing harm to the Cuban revolution" and ordered him to leave the consulate.

The next morning, Saturday, Sept. 28, Oswald returned to the Soviet Embassy while the KGB men were suiting up for a soccer game with their rivals in miltary intelligence, the GRU. This time, he was brought to a third consular official and KGB officer, Pavel Yatzkov, who remembered, according to a CIA report, that Oswald "was nervous and his hands trembled."

Within minutes they were joined by Kostikov, who spoke English. Oswald told his story again about his 2 1/2 years in the Soviet Union and his return to the United States in 1962. According to Kostikov, Oswald even dropped hints that he had "supposedly carried out a secret mission" without specifying what it was or who it was for.

Oswald then repeated his request for a visa to Moscow and said he was "motivated by the fact that it was very difficult for him to live in the United States, that he was constantly under surveillance, even persecuted, and that his personal life was being invaded, and his wife and neighbors interrogated. He claimed he lost his job {at a photo lab} because the FBI had been around his place of employment asking questions.

"In recounting all this, he continually expressed concern for his life," Kostikov said. He described Oswald as "extremely agitated and clearly nervous, especially whenever he mentioned the FBI."

It was at that point that Oswald pulled out the revolver and put it on a table, saying, "See? This is what I must now carry to protect my life."

Yatzkov grabbed the gun, took the cartridges out and put them in a drawer. When the meeting was over, Oswald picked up the gun again, put it in his pants, and Yatzkov gave back the bullets.

Oswald was known as a loner and was in trouble from the time he was a teenager. He joined the Marines at 17, read Marxism, studied Russian and criticized capitalism when politics was discussed. He got into trouble with a superior while serving in Japan and was busted in rank. Discharged in November 1959, he sailed to England, telling his mother he was going to school in Switzerland. Instead he went to Moscow and tried to become a Soviet citizen.

He carried on with several Russian women and finally married Marina Prusakova, 19, a pharmaceutical assistant in Minsk, where Oswald had been settled. By then he had soured on Soviet communism and was ready to go home. The Soviets were happy to see him leave and let Marina go with him because she was a lowly clerk at her factory, but it took almost a year before the U.S. government would let him back in.

Oswald was a target of FBI interest from the time his boat, the Maasdam, docked in Hoboken, N.J., on June 13, 1962. But the statements Oswald reportedly made to the KGB in Mexico City about the bureau's interest in him clearly were exaggerated. In fact, in those days the FBI did not keep close tabs on any of the 17 returned defectors from the Soviet Union. They did, of course, keep some tabs on him.

The bureau had been interviewing neighbors, some employers, and others as part of an ongoing investigation of Oswald as a possible recruit of the KGB. FBI agents questioned Oswald directly in June 1962 just after his return from Moscow and again in August. The bureau went looking for him again in Fort Worth and Dallas in the spring of 1963. A second FBI agent questioned a landlady who told him that she had just evicted Oswald because he had been "drinking to excess and had been beating his wife on numerous occasions."

Oswald had had a bad temper since he was a child. When he was a teenager, he sometimes slapped his mother and he threatened his stepbrother's wife with a pocketknife. When his mother told him to put it away, he hit her. In 1953, while living in New York, Oswald was sent to Youth House, the city's detention home for delinquent children, for six weeks of "observation and diagnosis."

"Lee has vivid fantasy life, turning around the topics of omnipotence and power, through which he tries to compensate for his present shortcomings and frustrations," the chief psychiatrist at Youth House wrote after interviewing the 13-year-old Oswald. "{W}hen we asked him whether he prefers the company of boys to that of girls, he answered -- 'I dislike everybody.' "

Oswald's mother, Marguerite, however, "never admitted that there was anything abnormal about Lee's behavior," Robert Oswald, Lee's brother, wrote later. "If she had faced it -- if she had seen to it that Lee received the help he needed -- I don't think the world would ever have heard of Lee Harvey Oswald."

In the fall of 1962, according to his wife Marina, Oswald began taking an interest in the controversial activities of right-wing retired Army Gen. Edwin A. Walker. Oswald complained of Walker's anti-civil rights stances and associations with the militantly anticommunist John Birch Society. "The fact that Walker, who seemed to carry about in his very person the threat of 'fascism' in the United States, actually lived close at hand in Dallas, seems to have stirred Lee a good deal," according to Marina's biographer, Priscilla McMillan.

In late January 1963, Oswald ordered his revolver, a Smith & Wesson .38 Special caliber, and that same day, McMillan reported, he first hinted to Marina that he was thinking of sending her back to Russia. Marina said his abuse stepped up around the same time, when he discovered a letter she had written to an old boyfriend in Minsk.

By March, he was photographing Walker's house in Dallas and filling up a blue loose-leaf folder with notes for an escape route and other data suggesting his plans to shoot the general. "He wanted to leave a complete record so that all the details would be in it," Marina told McMillan.

On March 12, Oswald ordered his rifle, a Mannlicher-Carcano. Both the rifle and the revolver arrived around March 25 and on March 31, in his back yard, Oswald asked Marina to photograph him, all in black, holding both weapons.

Walker was sitting at his desk at home around 9 p.m. April 10, 1963, when a rifle bullet smashed through a window and skimmed his hair. There were no witnesses, although a 14-year-old from a nearby house told police that right after the shooting he saw two men, in separate cars, drive out of a church parking lot adjacent to Walker's home. Marina told FBI agents Oswald came home by bus, after burying the rifle, which he retrieved four days later. Walker, who died recently, never believed Marina's account.

Oswald moved to New Orleans later that month to find a job and in early May he was joined by Marina and their baby. He began organizing a local Fair Play for Cuba Committee, handing out pro-Castro circulars and membership applications in an apparent search for attention. On Aug. 9, Oswald got into a scuffle with three anti-Castro Cuban exiles and wound up in jail, where he asked to be interviewed by the FBI. An agent interviewed him at the police station on Aug. 10, and Oswald told false stories about the size of the pro-Castro group he supposedly was running and the meetings it was holding.

The notoriety caused by his arrest won Oswald a radio interview and then a broadcast debate, which ended disastrously for Oswald. The host, who had checked with the FBI, almost silenced Oswald by bringing up his defection to Russia.

With life unhappy and another child on the way, Oswald had been talking for months about leaving the country again and going to Cuba or returning to the Soviet Union. He had already been seeking permission for Marina to return and, in June, he wrote the Soviet Embassy in Washington asking for himself.

By mid-September, the Oswalds agreed that Marina would return with daughter June to the Dallas area to live with a friend, Ruth Paine. After they left New Orleans on Sept. 23, Oswald departed for Mexico. He had told Paine he was going either to Houston or Philadelphia to look for a job.

In Moscow, Oswald's visa requests for Marina and himself were routed to an unenthusiastic Soviet bureaucracy familiar with the defector's case. Back in November 1959, according to Nechiporenko, Oswald had been debriefed twice by KGB counterintelligence agents when they were weighing whether to permit him to stay and if he had promise for Soviet intelligence. But the KGB lost interest in Oswald after the ex-Marine went to the U.S. Embassy in Moscow and told officials there he was going to defect and if necessary tell secrets to the Soviets. With that act, Nechiporenko said, Oswald "had exposed himself forever to American intelligence and therefore became useless to KGB intelligence."

As was done in all defector cases then, it finally took a resolution by the Central Committee to allow Oswald to remain in the Soviet Union over the KGB's opposition.

Nechiporenko was given access to Oswald's KGB files for his book, a concession others have been seeking for years. His presentation parallels much other information from both U.S. and Soviet sources, but in some areas his facts are unique and so far uncheckable.

In the book, he quotes for the first time from a Nov. 27, 1959, memo on Oswald signed by then-Foreign Minister Andrei Gromyko and then-KGB Chairman Aleksander Shelepin at the direction of Anastas Mikoyan, a member of the Politburo.

The memo permitted Oswald to stay for a year, "keeping in mind that Oswald has not been sufficiently studied" to give him the citizenship he was looking for. This also would give the KGB time to determine whether he was an American spy. The KGB refused to let him reside in Moscow but agreed to Minsk. There the local KGB assigned his case "to the so-called highest category, that is, one involving espionage," Nechiporenko said. "All means of available surveillance and countersurveillance technology were at the KGB's disposal, in addition to as much manpower as was needed to carry out round-the-clock observation of the subject."

On Dec. 21, 1959, the KGB opened an espionage file on Lee Harvey Oswald. Back in the United States, government agencies, including the Navy, the FBI and the State Department, had already started their own files. Shelepin's successor as head of the KGB, Vladimir Semichastny, said in a recent interview that he got reports on Oswald "from time to time" while he was living in Minsk.

When the KGB intercepted Oswald's first letter to the U.S. Embassy in 1961 indicating he was thinking of leaving the Soviet Union, it was immediately reported to Semichastny. "Thank God!" Semichastny remembers saying. "Immediately we sent a note to the Ministry of Internal Affairs saying let him out."

Oswald, it is now clear, was subjected to extremely tight surveillance in the Soviet Union, much tighter than he ever got from the FBI. Oswald's KGB files, Nechiporenko said, include reports from fellow workers, neighbors and even from several of the women he dated.

In Minsk, Oswald joined a hunting club at the factory where he worked and in August 1960 was permitted to buy a shotgun. After Kennedy's assassination, there were early reports from a KGB defector that Oswald was a poor shot, but the Warren Commission was given access to top-secret intercepts in which Minsk military officials claimed credit for teaching him how to shoot, according to commission lawyers. An FBI report on a talk Oswald gave in the summer of 1963 noted that Oswald talked of how much he enjoyed his weekend hunting trips outside Minsk.

At the end of 1961, according to Semichastny, the KGB decided "we were certain that this kind of person could not be a U.S. intelligence agent" and recommended to the Supreme Soviet that no obstacles be placed in the way of the Oswalds' departure. Soviet permission was granted in December, but the U.S. bureaucracy proved sluggish.

Fearful that U.S. intelligence might require Oswald to demonstrate his allegiance with some anti-Soviet activity, the KGB stepped up its surveillance, Nechiporenko reported. It soon discovered that Oswald was trying to build some bombs and had made "two iron casings" each with two compartments, "one filled with shot and the other explosives," as well as paper-tube fuses.

Surveillance was ratcheted up again, "especially before different celebrations, congresses and high-level political meetings," Nechiporenko said, but ultimately, Oswald threw away the bomb casings. "The KGB was greatly relieved, but it did not discount the possibility of another weird act before his departure," the retired KGB colonel said.

All this was on the KGB's mind in late September 1963 when the Mexico City station cabled Moscow for instructions on how to deal with Oswald's newest request for a visa. By the time of the assassination, the KGB files also contained a Nov. 9 letter Oswald wrote to the Soviet Embassy in Washington, reporting on his trip to Mexico and his description of yet another confrontation with "the notorious FBI."

Still pressing for a visa, Oswald said he had been "warned" that the FBI would "take an interest" in him again if he tried his Fair Play for Cuba activities in Texas. He also complained that an FBI agent " 'suggested' to Marina Nichikayeva that she could remain in the United States under FBI 'protection.' " Oswald said he objected strenuously.

The Byelorussian KGB in Minsk wanted Marina Oswald back "for propagandistic purposes," but Moscow said no. The KGB there and the Foreign Ministry rejected her request Oct. 7, 1963, while her husband's request was still pending. The KGB in Minsk was informed of the decision about Marina in a letter dated Nov. 22, 1963, the day President Kennedy was killed.

When Oswald's picture flashed onto TV screens in Mexico City later that day, Kostikov rushed into Nechiporenko's office and shouted:

"Oleg, they just showed the suspect in Kennedy's death on TV! It's Lee Oswald, the gringo who was here in September! I recognized him!"

Researchers Anne Eisele in Washington and Yevgenia Albats in Moscow contributed to this report.