The excited neighborhood children were coming in Wednesday for free ice cream cones, a special feature of the cheerful McDonald's restaurant in this shabby border town, when the tall, bespectacled man walked in with a shotgun, pistol and semi-automatic rifle.

"Everybody down!" he yelled. He put a radio tuned to the local news on the counter, then while children wept in their seats and mothers screamed in horror, he turned the room of plastic tables and cartoon decorations into a chamber of blood and death.

Within 15 minutes, police investigators said today, an irascible, unemployed security guard from Ohio named James Oliver Huberty had killed 20 people and fatally injured one more.

When, an hour later, a bullet from the scope-mounted .308 caliber rifle of a San Diego police sharpshooter slammed into Huberty's chest, killing him instantly, there had been little clue to what unleashed this human cluster bomb in a place of laughter, birthday parties and brightly uniformed teen-aged workers.

Huberty's wife, Etna, who earlier told police that she had no indication that anything was wrong, tonight said in a statement to a San Diego television station that her husband calmly told her before leaving the house that he was "going hunting humans."

She said that his livelihood back home in Ohio had fallen through in the recession and that he could not even arrange an appointment at a mental health clinic he telephoned Tuesday.

All that is immaterial to Omar Hernandez, the dark-eyed 11-year-old who was president of his sixth grade class at nearby Sunset Lane Elementary School. One of the bullets from Huberty's 9mm Uzi semi-automatic rifle, shattering the restaurant's big windows and spraying the brightly decorated playground outside, struck Omar as he tried to escape on his bicycle.

The dead ranged in age from 74 to eight months. Five were under 12. Somehow 10 people who had been in the restaurant managed to survive.

Executives of McDonald's Corp., who lost four young employes in the carnage, announced today that they would suspend national advertising because of the tragedy. Joan Kroc, widow of the fast food chain's founder, Ray Kroc, announced at a news conference called by San Diego Police Chief Bill Kollender that she had contributed $100,000 to start a fund for victims and their families.

From police, neighbors, victims' relatives and some of the 10 hospitalized survivors and others who miraculously escaped injury in the 77 minutes of terror, a story emerges full of unexplained twists and emotional gaps.

Huberty, 41, who once told friends he was moving to Mexico to escape the coming nuclear war, arrived in San Diego with his wife and two daughters in December from Massillon, Ohio. About a month ago, they moved to a $475-a-month, two-bedroom townhouse at the Averil Villa apartment complex in this predominantly Hispanic San Diego suburb, just 1 1/2 miles from the Mexican border.

The two-story, stucco building sat on a hillside, and Huberty's daughters Zelia, 13, and Cassandra, 10, could see the McDonald's restaurant next to Interstate 5 from their balcony.

Wanda Haseley, 27, a bartender whose husband, like many in the area, is in the Navy, learned quickly that Huberty was a quiet, somewhat unfriendly man who could sometimes be heard late at night working on his home computer. The bumper sticker on the rear of the black Mercury sedan he drove to McDonald's said, "I'm not deaf -- I'm ignoring you."

Haseley's daughter Tamara, 6, had seen what she thought was a revolver under the pillow of Huberty's bed when she played there one day. There were many weapons in the house, but Haseley had hunters in her family and was not concerned.

Huberty's wife "was the typical next-door neighbor who likes to sit down and have a cup of coffee," Haseley said. "She liked to talk about their days in Ohio." Haseley knew the Hubertys argued and the daughters "didn't care for their father much," but she liked the girls and let them babysit for her two daughters.

Huberty had gotten a job as a security guard at a condominium complex, but was fired a week ago. Police, who have talked to Huberty's wife at length, said he seemed despondent over this.

Police say they know of no serious criminal record, but he was cited for speeding in San Diego on March 1, and on June 15 he was ticketed for driving on the left side of a divided road and for driving without a registration sticker.

Huberty began Wednesday with an unpleasant chore, reporting to traffic court in northern San Diego, 20 miles from his home. San Diego Police Lt. Paul Ybarrondo, homicide section head, said Huberty took his family and was pleased when the judge let him off without a fine.

The family had breakfast in a McDonald's near the court, then visited the San Diego Zoo. By mid-afternoon, they were back in San Ysidro. Mrs. Huberty told police that her husband, dressed in his usual maroon short-sleeved shirt and camouflage pants, said he was going out for a while, and that she took a nap, thinking nothing was wrong.

Haseley, however, said Cassandra Huberty came to her sometime in the afternoon and said her parents had had a serious quarrel. "She said 'Dad is really upset. He's really angry, and I don't want to go home.' " Haseley left the girl to watch her daughters while she and her husband did an errand.

In her rambling statement tonight, Etna Huberty said she was sorry for what her husband had done. "He had always been a nervous person who could not take much pressure," she said. "He had a very unhappy childhood. He was very sad. He came from a broken home . . . . His only close friend was his dog, Shep."

She said that she urged him to move back to Ohio and that he had started to hear voices. Shortly after his arrival here, after he tried living in Mexico for a while, she said, he got into a police car and told an officer he was a war criminal. He was questioned briefly and released.

She said he took no illegal drugs but had health problems related to several automobile accidents. "In a normal state of mind, he loved children, in particular little girls," she said. "He would never harm a child."

It had been an unusually hot July and the temperature Wednesday had again climbed well into the 80s when Huberty drove his car the 200 yards down Averil Road to McDonald's. "Over 45 Billion Served," said the brightly lit sign under the familiar golden arches. "Drive Thru Service."

A walled-in playground with the equipment festooned with the heads of Mayor McCheese and other franchise cartoon characters drew as many children as the free ice cream.

Neva Caine, 23, the manager, always prepared for a rush of business about 3:30 p.m. Children got out of school, factory workers ended their shifts, the stream of travelers to and from Mexico sought a midafternoon rest stop and the heat brought many inside for the air conditioning.

It was a good business, in the middle of a string of motels, shops, banks and a post office that hugged the edge of the highway. Caine had married in Arizona a month before. Now she and her husband were planning to travel to New York soon to repeat the ceremony for another set of relatives.

Huberty had stuffed his pockets with hundreds of rounds of the little 9mm cartridges for the Uzi, a favorite Secret Service weapon easily purchased for $500 at good gun shops with no need for a permit if it was the semi-automatic model. On his other shoulder he carried a 12-gauge slide-action shotgun, and in one hand a 9mm Browning semi-automatic pistol.

One restaurant employe, seeing Huberty walk in the door at 4 p.m., ran to a telephone in the back of the store to call police. He heard the gunman yell, "Everybody down!" followed by a short silence, then shots and screams. He was wounded and managed to crawl out the back, leaving the phone off the hook.

John Arnold, one of the teen-age restaurant workers wearing distinctive red- and white-striped shirts, said he first thought that Huberty was joking when he entered the restaurant with one rifle raised to fire.

Caine, the newly wed manager, tried to say something to the gunman, and was immediately shot. As she lay on the floor whimpering, Arnold told friends, Huberty stood over her and shot her several more times, making sure she was dead.

Witnesses reported that Huberty shouted, "I've killed a thousand and I'm going to kill a thousand more," but this was the first time Huberty, who never served in the armed forces, had used his carefully accumulated weapons on people.

Arnold, who said he hid under a serving table, said he heard Huberty muttering, "Come on, buy your burgers with the ketchup on it" as he walked from body to body. Restaurant workers hiding in a basement room said they heard him switch the radio to a rock music station, then a soul music station.

Omar Hernandez, with his 11-year-old friends David Flores and Joshua Coleman, had bicycled to McDonald's for ice cream. "It was the most expensive ice cream cone he ever had," said Flores' uncle, Salvador Delgado, as he helped lead the boy's stunned mother and grandmother away from a makeshift identification room at a local community center.

Joshua's friends were dead. He had wounds in his arms, leg and back. His mother said later he played dead, singing to himself while bullets ricocheted off the street in front of him. Another mother later told police she rushed out of the restaurant, then remembered she had left a 3-year-old child behind. She managed to beckon to her son, crying in his seat, when Huberty was looking elsewhere, and both escaped.

Armando Rodriguez, another 11-year-old who lived across the street, had been kicking a ball in his front yard when the shooting started. He hit the ground and watched the man in the restaurant shoot out all the windows. A shotgun Huberty had been using suddenly jammed, and Rodriguez used the moment to flee to the back of his house.

A transcipt of early police calls shows officers startled and confused, with little notion of the extent of the carnage:

Patrol car: "Do we have any direction of travel or anybody coordinating this?"

Dispatcher: "Nope, nobody is coordinating anything . . . north side of McDonald's. Can you tell me where the little girl is?"

". . . Two victims on the north side of McDonald's . . . is that in a clear area where paramedics can get to them?"

Patrol: "Negative. It's the line of fire."

A patrol car responding to the first calls was hit by two shots. A fire truck was also fired upon. From their balcony high above the scene, one of Huberty's daughters could see his car parked next to the restaurant.

Told of the shooting as they returned from their errand, Haseley and her husband just laughed at what sounded like a hoax. Then, realizing the seriousness of the outbreak, Haseley spoke to Etna Huberty. Now worried that her husband might be involved, Huberty called police. Within a half hour, the police Special Weapons and Tactics Team had arrived.

"We couldn't just go in," said Kollender, "we thought he might still have hostages there." Another half hour passed, as sharpshooter Chuck Foster climbed to the roof of the post office next door for a good angle. The SWAT team commander now knew from eyewitness reports that Huberty had apparently shot everyone he could find. Snipers were told to fire.

At 5:17 p.m., Foster saw him in his scope, standing in front of the counter like a customer waiting for an order. He squeezed off one round, followed by two shots from a police rifleman on the ground and a patrol officer with a revolver. Only Foster's shot hit, but it was enough.

When, after several minutes, Huberty had not moved, the SWAT team rushed in to find a bloody carnage, but also 10 survivors, who had hidden behind walls, in a basement room, or played dead. San Diego Mayor Roger Hedgecock said his stomach churned as he walked in five minutes later to see the bodies, left lying for hours while investigators sifted for clues.

Hedgecock said he saw "a couple with a child in between them. A very young girl and a parent on the floor next to her. A man in his 20s or 30s. An older woman slumped in a booth. Two teen-age boys in T-shirts and shorts with their dinners still half-eaten on the table." Omar Hernandez' mother, president of her PTA, was not allowed near her son's body, but was motioned to go over to talk to officers. She began running down the street pulling her hair and screaming, "They've killed him! He's dead, he's dead." Police officer R.L. Harrison, a veteran of the 101st Airborne Division, surveyed the scene and shuddered. "I haven't seen anything like that since I was in Vietnam," he said. "I hope I never see it again."