A man living with his mother in a South Florida apartment complex set their unit on fire and went on a shooting rampage throughout the building, killing six people before being shot to death by police. As the eight-hour standoff unfolded, horrified residents hunkered down in their homes, at times so close to the action they could feel the gunfire or hear negotiations between the gunman and police, authorities and witnesses said Saturday.

In the final hours, Pedro Vargas, 42, held two people hostage at gunpoint for up to three hours in their apartment until a SWAT team entered and killed him, police said. The hostages were not hurt.

"The crime scene is the whole building," said Lt. Carl Zogby, a spokesman with the Hialeah Police Department.

Police were called to the aging, five-story apartment building in Hialeah, a working class suburb a few miles northwest of downtown Miami, on Friday at 6:30 p.m. The first calls reported a fire, but when firefighters arrived, they heard shots and immediately notified police, Zogby said.

Vargas, who has no known criminal record, set a combustible liquid on fire in his fourth-floor apartment. Building manager Italo Pisciotti, 79, and his wife, Camira Pisciotti, 69, saw smoke and ran to the unit, Zogby said. When they arrived, Vargas opened the door and fired, killing both.

Detectives were investigating whether Vargas had any ongoing disputes with the building manager, as some residents believed. His mother was not home at the time.

After gunning down the building managers, Vargas went back into his burning apartment and fired 10 to 20 shots from a 9mm pistol into the street. One of the bullets struck 33-year-old Carlos Javier Gavilanes, who was parking his car after returning home from work. Zogby said his body was found next to his vehicle.

The gunman then kicked his way into a third-floor apartment, where he shot to death Patricio Simono, 54; his wife Merly Niebles, 51; and their 17-year-old daughter. Family members said Simono worked at a car wash and Niebles cleaned hotel rooms. Their daughter wanted to be a nurse.

All six people were killed in a short time span, Zogby said, and it's possible they were all dead by the time police arrived.

Officers and Vargas then engaged in an hours-long shootout and chase, with police following the gunman from one floor to the next.

"He kept running from us as he fired at us and we fired at him," Zogby said.

Several hours into the ordeal, Vargas forced his way into a fifth-story unit and held two people captive. Sgt. Eddie Rodriguez said negotiators and a SWAT team tried talking with him from the other side of the door.

Miriam Valdes, 70, was in a friend's apartment two doors down. She said she heard officers trying to convince Vargas to surrender.

"Pedro let these people out," Valdes said officers told him. "We're going to help you."

She said the gunman first asked for his girlfriend and then his mother but refused to cooperate.

Rodriguez said the talks eventually "just fell apart." Officers stormed the building, fatally shooting the gunman in an exchange of gunfire. Zogby said Vargas still had several rounds of ammunition when he was killed.

"He was ready to fight," Zogby said.

The hostages, identified as Zoeb and Sarrida Nek, were shaken up but not hurt, he said.

Police and neighbors described Vargas as a quiet man who had only recently moved into the building.

Tenants painted a mixed portrait of the gunman.

"He was a good son," said Ester Lazcano, who lived on the same floor as Vargas and his mother. "He'd take her in the morning to run errands" and to doctor appointments.

Lazcano said she was in the shower when she heard the first shots, then there were at least a dozen more. "I felt the shots," she said.

Valdes said Vargas was also known as a difficult person who sometimes got into fights and yelled at his mother.

"He was a very abusive person," she said. "He didn't have any friends there."

Zogby called Vargas' background "unremarkable." Police had not responded to any prior calls at his home.

"Nobody seems to know why he acted the way he acted," Zogby said.

As police investigated the crime scene, relatives of the victims began arriving to pick up their loved ones' belongings. Residents came out of their complex and spoke among each other as the sky turned dark and threatened to rain. Some had large swaths of water in their apartment from the firefighters who responded to extinguish the blaze.

Vargas' apartment door and the ceiling outside it were charred.

Agustin Hernandez, Merly Niebles' brother-in-law, loaded several old pictures and other items from his relative's apartment in a grocery cart and into his car. One showed his teenage niece smiling in a red graduation gown. Another pictured his sister-in-law posing in a white dress and pearls.

A binder also from the apartment had pop artist Justin Beiber's name on the spine, presumably belonging to the teenage girl, who family members identified as Priscilla Perez.

Marcela Chavarri, director of the American Christian School, said the Perez was about to enter her senior year.

"She was a lovely girl," Chavarri said through tears. "She was always happy and helping her classmates."

In Hialeah -- a suburb of about 230,000 residents, about three-quarters of whom are Cuban or Cuban-American -- the block around the apartment building was closed off with crime scene tape. At about midday, officers removed a body from the building and carried it away in a van.

Detectives, meanwhile, tried to piece together every shot and every minute of what had happened.

"It could have been a much, much more dangerous situation," Zogby said.