In the fall of 1985, agents were leaving the FBI's Manhattan office at the rate of seven a month, complaining they couldn't afford to live in New York on a G-man's salary. With beginning agents making less than a city sanitation worker, and salaries no better in New York than in El Paso or Boise, many quit the bureau rather than be sent there.

The money squeeze was so bad that Assistant FBI Director Thomas L. Sheer, who headed the Manhattan office, publicly warned that his agents were vulnerable to recruitment by hostile powers. Some joked blackly about spies in their ranks.

Into this cauldron of malcontent came a new transfer from FBI headquarters in Washington.

Robert Philip Hanssen, a nine-year bureau veteran known for being cerebral and standoffish, was assigned to head a foreign counterintelligence squad, an unglamorous but important job in a city where one-third of the 2,800 Soviet-bloc diplomats were thought to be spies.

For the Hanssen family -- Bob, his wife, Bonnie, and their six children, the youngest just an infant -- the new posting meant sacrifice. They sold their four-bedroom, 2 1/2-bath house in Fairfax County for $175,000, then turned around and spent almost as much for a cramped three-bedroom, 1 1/2-bath ranch house in Yorktown Heights, 90 minutes north of New York City.

By early 1987, Sheer had quit the FBI, saying flatly that his $72,500 salary left him broke. Hanssen, who was earning about $46,000, would make a different choice.

While his motive remains unexplained, within nine days of joining the New York office Hanssen mailed the first of his letters to the KGB, the FBI alleges, offering stolen secret documents in return for $100,000.

Today, New York FBI spokesman Joe Valiquette says, "Tom Sheer looks like the smartest man in America."

Diverging Impressions Those who thought they knew 56-year-old Robert Hanssen well are shocked and mystified by the 15 years of betrayal and lies laid out in clinical detail in a 109-page federal affidavit last week. To them, his fruitful career as a wily but crass double agent is all but impossible to reconcile with the seemingly pious, Chicago police lieutenant's son who kept a crucifix on the wall behind his office desk.

Hanssen, arrested on espionage charges at a drop site in a Fairfax park last Sunday, stands accused of taking more than $600,000 in cash and diamonds from the Russians, with $800,000 more allegedly waiting for him in a Moscow bank.

His attorney has said Hanssen will plead not guilty.

A complex and often contradictory portrait emerges from the pages of the FBI's charges and interviews with dozens of Hanssen's friends, relatives, colleagues and neighbors.

To be sure, the financial pressures he faced with six children in private school were substantial for a man on a government salary. In one of his earliest communications with his KGB handler, the would-be spy asked for payment in diamonds, "as security to my children." He later returned two gems to the Russians, asking for cash instead, according to the FBI.

Some who worked with Hanssen through the years cannot believe he is the man who wrote those letters and sold out his country for money.

They describe a man who seemed to shun all displays of ostentation. He favored hamburgers for lunch, owned three older vehicles and drove his family to Florida on vacation to visit their grandmother.

Hanssen, some suspect, must have been energized by the intellectual rush of outsmarting an opponent -- even if that opponent was his agency and the cause he served for 25 years.

"It's not a story about gain. It's a story about game," said David G. Major, a former FBI counterintelligence official who has known Hanssen for more than two decades and was once his boss.

The public Hanssen railed in 1950s terms against Marxist-Leninist infiltrators. Raised as a Lutheran, he converted to Catholicism after he married and later became deeply involved with Opus Dei, a conservative Catholic organization.

His politics, too, were conservative and family-oriented. He attended antiabortion demonstrations and gun shows, decried communism for being "godless" and referred reverentially to the FBI's first director as "Mr. Hoover."

By contrast, the double agent who operated under the code names B, Ramon and Garcia was routinely profane and dismissive of his employer and country. He contemptuously compared the United States to an idiot savant and referred to his KGB handlers as "dear friends" to whom he was "insanely loyal," in letters quoted in the affidavit. His disdain for the FBI only seemed to increase as he continued to elude discovery.

Boasting degrees in chemistry and accounting, Hanssen was known within the bureau as an intellectual for his mastery of arcane details. Initially, some acquaintances said he had the nickname of Dr. Death because he dressed as properly and somberly as a mortician. But his good friends say it was because he sometimes was so deadly boring that he could induce sleep in colleagues. He delved into computers in the early 1980s, when everyone else was still using electric typewriters, and taught himself two computer programming languages, C and Pascal.

James Bamford, an author of books about intelligence-gathering, met Hanssen through a mutual acquaintance seven or eight years ago. The two became friends -- Hanssen attended Bamford's wedding -- but Bamford said he now believes there was another, darker side to the man. "He had an extremely secret life," Bamford said. "It was almost to the point where he had a split personality right down the middle. It's the most complete alter ego I've ever seen."

David Charney, a psychiatrist who has studied spies and was a defense expert in the case of Earl E. Pitts, an FBI agent charged with espionage in 1996, said Hanssen may have privately been frustrated with how his life was turning out. "Everyone is their own worst critic," Charney said. "If they're not satisfied with these ideals, it creates a disease within them."

A target is needed to release the frustration, he said, and often it's the workplace. "To anybody in espionage, what's the worst thing you can do to sabotage someone who didn't appreciate you, who didn't promote or support you? Give away their secrets," he said. "But here's the crux: Once you've stepped over the line, there's no turning back. . . . You're trapped. There are no credible exits. So you resign yourself to living this life."

James K. Kallstrom, who met often with Hanssen in the 1980s as head of the FBI's special operations division, now wonders whether Hanssen was as smart as he seemed.

"He had to know the Russians were keeping a record of every contact they had with him," Kallstrom said. "And it's obvious once the FBI got hold of his [Russian] file, they were able to figure out who he was. The guy may have been smart and cunning, but he was dumb."

Midwestern Roots Hanssen was born in April 1944, the only child of a Chicago cop. As a young man, he seemed to be seeking a way out of the blue-collar life represented by his boyhood neighborhood of modest brick and wooden bungalows on the city's western edge.

At Taft High School, the 1962 yearbook lists him as an honors student, a member of the Radio Club and a teaching assistant, and bears this notation under his photograph: "Science is the light of life."

With a degree in chemistry from Knox College, a private liberal arts campus in downstate Illinois, he next flirted with dentistry but dropped out of Northwestern University's dental school after two years.

Paul Moore, a friend and former FBI agent, remembers Hanssen saying he was a good enough dentist, he could look at a decayed tooth and figure out how to approach the problem, "but he didn't want his fingers to be stuck in somebody's wet mouth all day."

Instead, he switched to accounting, receiving a master's in business administration in 1971.

Hanssen was raised in the Lutheran faith, according to his mother, Vivian, and attended Lutheran churches through college. Soon after his 1968 marriage to Bonnie, who comes from a large Catholic family, he converted "because he wanted to keep his family one religion," Vivian Hanssen said.

After Northwestern, he worked briefly as an accountant, then joined the Chicago Police Department in October 1972, three months after his father, Howard, ended his 30-year police career and retired to Florida.

Directly out of the police academy, the younger Hanssen was named to a new undercover unit called C-5, so cloaked in secrecy that its 30 or so members had fictional assignments placed in their personnel files. Hanssen was listed with the vice squad but never worked there, nor did he ever walk a beat, said Pat Camden, a department spokesman. C-5's job was to ferret out corrupt police officers, and its members were considered an elite corps.

Even in that rarified group, Hanssen stood out, said Ernie Rizzo, a private investigator who knew Hanssen when they attended a secret electronics surveillance school that operated in a Chicago storefront disguised as a television repair shop.

"He wasn't flashy. He was just a plain, church-going kind of guy, the kind of guy you get in counterintelligence," Rizzo said. "He was too young in the business then to have a reputation, but you could tell he was really smart."

Jack Clarke, a security consultant for C-5, thought Hanssen overqualified to be a police officer: "Finally, one day I took him aside and said, 'Go down to the federal building and put in an application for the FBI. You shouldn't be here.' "

Brainy and Philosophical There was a Walter Mitty quality to the beginning of Hanssen's career in the FBI.

He joined Jan. 12, 1976, and did stints in Indiana and New York City before being transferred to headquarters in 1981.

Much of his early work drew on his accounting background. He tracked white-collar crime. He set up an automated database to monitor foreign officials assigned to the United States. He worked on budget requests to Congress and spent two years in the Soviet analytical unit.

If Hanssen stood out, it was as a brainy guy who had little interest in standing around the water cooler talking about the Redskins.

"The kind of person who would walk into your office and have a very philosophical discussion about anything from computers and counterintelligence tradecraft to philosophy, ethics and classical music," said Major, who now trains CIA officers in Alexandria.

"He was a moral and ethical man," said Major, recalling that Hanssen characterized communism as "godless."

"Not that many people talk like that, but he did."

Hanssen was comfortable talking about his faith. Moore recalls driving with Hanssen when someone on the radio obliquely referred to morality as an implied social contract. Hanssen reached over, clicked off the station and said: "That's enough of that. The basis of morality is God's love."

Bamford, the writer, said Hanssen's professed Christianity and anti-communism defined him. "The two most prominent aspects of his personality were his religiosity and, ironically, his anti-communist passion," he said. " . . . And he was extremely conservative in terms of his political philosophy -- very, very antiabortion, marching in antiabortion rallies, and very pro-gun."

An incident with a civilian FBI employee in February 1993 gave some the impression that he had misogynistic tendencies. The employee, Kimberly Lichtenberg, said she enraged Hanssen by walking out of a meeting. He chased her, grabbed her by the arm and swung her around so violently she fell, then started to drag her back into the meeting room, Lichtenberg said. She said that she had bruises on her arm and face and that Hanssen was suspended for five days without pay. A government official confirmed the incident.

"He thinks women are beneath him," said Lichtenberg, who filed a lawsuit against Hanssen that was later dismissed when she failed to appear for a court hearing. She said she had never been notified. "How dare I disobey him? That's the worst thing I could've done."

No one remembers Hanssen explicitly criticizing the bureau, at least not at the time he is alleged to have started spying.

"He seemed to be disappointed in the FBI at the end there," Moore said. "But not before, and certainly not in 1985."

To his friends, Hanssen sounded resigned to moving from FBI headquarters back to New York in 1985 as necessary to advance his career.

"You have to get your ticket punched, be a squad supervisor," Moore said. "And he had a good post up there, as opposed to being in Queens or someplace. He seemed to be happy about it and reconciled to the idea that it was going to be expensive."

Neighbors in New York recall that the Hanssens pinched pennies.

"Like any big family, they seemed a little strapped for money," said Mary Barchetto, who lived across from the family on Mead Street in Westchester County. "The mother was handy, though. She made the duvet covers herself from sheets she bought.

"Westchester is a tough place to live if you don't have a lot of money."

The Hanssens did well on real estate transactions, though. They sold their first Vienna home for $25,000 more than they paid four years earlier; and their Westchester house, which they owned for 20 months, for $47,000 more.

A Frugal Lifestyle In the comfortable Vienna neighborhood around Talisman Drive, where the Hanssens settled in 1987 on their return to Washington, Hanssen was thought of as an involved father, a religious man, a well-respected FBI agent -- and arrogant.

"This was no Ward Cleaver," said neighbor Francine Bennett, who recalls Bonnie Hanssen remarking how much she missed her larger house on the other side of Vienna and found it tough to squeeze her children into the new one.

Robert Hanssen, she said, "was aloof to the point that most of us just stopped trying to interact with him. I've lived across the street from him for over 10 years, and I've never talked to the man. I've repeatedly said 'Good morning,' 'Good evening,' 'How are you?' 'Drop dead,' whatever -- and no reaction."

For most of last week, the family's $290,000 split-level house sat empty, surrounded by yellow "Crime Scene" tape. With Hanssen in federal custody and his wife and two teenagers still living at home temporarily ousted, FBI agents scoured the four-bedroom house, picking through his belongings and his past.

Friends and neighbors continue to grapple with the jarring possibility that one of the most damaging spies in history lived in their midst.

"There's nothing outstanding that would prepare you for something like this," said Mauro Scappa, 23, a technical recruiter in Washington who was close to Hanssen's oldest son in high school.

The family lived frugally, neighbors said. The parents attended school functions, shuttled the kids around and participated in church activities. They restricted what TV shows their children watched. Their rectangular dinner table has a chair at each end and a bench on either side for the kids.

FBI officials have told reporters that Hanssen used computers in a locked, basement room to record and process his communications with the Russians. Friends and neighbors, however, say the basement computer room they are familiar with was neither locked nor off-limits.

"I beat the game Frogger twice on the computer in that room," said neighbor Hadley Greene, 13, a friend of the youngest Hanssen daughter.

Robert Hanssen irritated some neighbors by letting his dog, a black Lab mix named Sunday, run unleashed in their yards, prompting at least three visits by county animal control and police officers.

Hanssen's unwillingness to control his dog despite repeated warnings antagonized neighbors, said Mike Shotwell, president of the homeowners association.

"Most of us knew he was an [FBI] agent," said Shotwell, describing Hanssen as aloof and unfriendly. "That's where we figured the arrogance came from."

One after another, the six Hanssen children trooped off to private schools affiliated with Opus Dei: the three daughters to Oakcrest, a girls' school now in McLean; the sons to The Heights, a Potomac school also attended by a son of FBI Director Louis J. Freeh.

Tuition at The Heights is currently $10,700 a year, while Oakcrest charges $9,000. One Hanssen son attended the College of William & Mary and is in law school at the University of Notre Dame. Another son is enrolled at the University of Dallas, a small Catholic school.

FBI officials place Robert Hanssen's salary at $87,000 to $114,000 a year. Bonnie Hanssen is a part-time teacher at Oakcrest, friends said.

"He lived like a guy making his salary who has six kids," Moore said. "I used to kid him, 'They're all insurance policies. They're all going to take care of you when you're old.' "

Hanssen's attorneys declined to comment for this article. Bonnie Hanssen, through those attorneys, also declined to comment. One of the couple's grown daughters said the children still love and support their father, but she declined to say more.

Hanssen's mother, Vivian, interviewed by telephone from her home in Florida, said: "It's unbelievable to me, and I can't imagine him doing something like that. But I love him just the same."

Orthodox Catholics Religion was central to the family's life. Instead of attending Mass near home, the family drove eight miles to a more traditional parish, St. Catherine of Siena, in Great Falls.

Both Hanssens belonged to Opus Dei, an international organization of Catholics whose members consider themselves orthodox followers of church doctrine. Members are expected to meditate and attend Mass daily and to regularly confess to a priest.

The group, founded by a Spanish priest in 1928, has 84,000 adherents worldwide and has generated controversy over the years. Some Catholics and others contend that it pressures vulnerable people to join, sometimes urging alienation from family and friends who don't strictly share its beliefs.

Opus Dei members say the group is about helping people find God in daily life. Members believe that all people are called to sainthood and that they get there by following orthodox rules and rituals.

Those who've known the Hanssens through church and school question how Hanssen the Catholic could have been Hanssen the spy, working on behalf of a political system that sought to repress religious expression.

"I still think of them as a family with very deep Catholic affections and roots," said Alvaro DeVicente, college counselor at The Heights. "But I'm baffled. If this were a single man who had no family connections and no other passions, I can see it. But how do you go home every night and look at your wife? How do you go to your parish every Sunday?"

Church leaders say they certainly didn't see the kind of big money Hanssen is alleged to have taken. His contributions to Opus Dei, according to a national spokesman, totaled $4,000 from 1988 to 1992; and he gave The Heights $200 or $300 annually -- not counting tuition -- from 1988 to 1998.

"Everything is alleged," said the Rev. C. John McCloskey, an Opus Dei priest based in Washington. "But obviously if it is true, he couldn't have done anything more against what Opus Dei stands for, or for that matter the church. It's unthinkable."

Examining the Pieces In the realm of spydom, double agents intrigue the most.

Colleagues and friends alike marvel that, if the allegations are true, Hanssen could have survived so long, never seeming to crack under the strain of living two fundamentally different and compartmentalized lives.

They now wonder: What was true and what was the illusion? Was the life they saw a ruse, no more than clever cover? Or was there truth in both?

John J. Hamre, a former deputy defense secretary, believes he sees clues in the letters authorities say Hanssen wrote to the KGB. They begin businesslike, Hamre notes, and degenerate into slavish thanks to his handlers for their good wishes and pleas for them to respond.

"It sounds like a guy who was living further and further into this deception," he said, "and was starving for the attention he felt he deserved."

To Paul Moore, Hanssen's longtime friend, it's a vexing puzzle.

"I can't make all the pieces fit together," Moore said. "I still have the question of why."

FBI agent Robert P. Hanssen was arrested at a park in Fairfax.FBI agents remove evidence from the Hanssens' house on Talisman Drive in Vienna on Tuesday.Hanssen, left, appeared briefly in federal court Tuesday and was ordered jailed without bond.Robert Hanssen, the son of a Chicago police officer, spent his boyhood in this bungalow on North Neva Avenue on the city's western edge.Hanssen graduated from Taft High in 1962.He graduated from Knox College in 1966.Hanssen is a 25-year veteran of the FBI.The Hanssen family lived in this house on Mead Street in Yorktown Heights, 90 minutes north of Manhattan, when Robert Hanssen was transferred to the New York office in 1985.Ernie Rizzo says Hanssen, then a Chicago police officer, stood out in an electronic surveillance class the two attended in the storefront behind him, which was disguised as a TV repair shop: "You could tell he was really smart."