"All of us at NASA are profoundly saddened by today's tragedy at the Johnson Space Center in Houston," NASA administrator Michael Griffin said in a written statement. "Our hearts go out to the families of the victims and all those touched by today's events."
The gunman was able to take a snub-nosed revolver past NASA security and barricade himself in the building, which houses communications and tracking systems for the space shuttle.
NASA spokesman Doug Peterson said the agency would review its security.
"Any organization would take a good, hard look at the kind of review process we have with people," Peterson said.
To enter the space center, workers flash an ID badge as they drive past a security guard. The badge allows workers access to designated buildings.
NASA and police identified the gunman as 60-year-old William Phillips. He apparently had a dispute with the slain man, Police Chief Harold Hurtt said without elaborating.
NASA identified the slain man as David Beverly, a 62-year-old NASA worker. Beverly was shot in the chest and was probably killed "in the early minutes of the whole ordeal," police said.
Beverly's wife, Linda, said her husband of 41 years was an electrical parts specialist who felt working at NASA was his calling.
"His intellect and his knowledge, David really felt he was contributor," she said.
Her husband had mentioned Phillips before, but she declined to say in what regard. Linda Beverly said it wouldn't be fair to Phillips.
The second hostage, identified by NASA as Fran Crenshaw, a contract worker with MRI Technologies, escaped after being bound to a chair with duct tape. She worked in the same general area and was presumably taken hostage after Beverly was shot, Hurtt said.
"She was very courageous, a calming influence in this whole issue and apparently was a very positive relationship between her and the suspect because he at no time that we know of threatened to do injury to her," Hurtt said.
Phillips, an employee of Jacobs Engineering of Pasadena, Calif., had worked for NASA for 12 to 13 years and "up until recently, he has been a good employee," Coats said.
He was unmarried, had no children and apparently lived alone.
The shooter left telephone numbers and names of people to contact and wrote a note on a dry erase board in the room, police said.
"I don't recall what was on it," Hurtt said.
During the confrontation, NASA employees in the building were evacuated and others were ordered to remain in their offices for several hours. Roads within the 1,600-acre space center campus were also blocked off, and a nearby middle school kept its teachers and students inside as classes ended. Doors to Mission Control were locked as standard procedure.
A source inside JSC told CBS station KHOU that a meeting was under way in a conference room when the gunman walked in and pointed a gun at one person. He ordered everyone else out.
The gunman shot himself once in the head more than three hours after the standoff began, police said. Initial reports indicated two shots were fired at about 1:40 p.m. and another shot was heard about 5 p.m.
Police said the gun used was a revolver purchased on March 18 at a local gun shop.
Jacobs Engineering provides engineering for the international space station, space shuttle and other spacecraft programs, and conducts research and development for new technology. In 2005, the company received a five-year contract with the space center worth up to $1.15 billion.