Dozens of employees at the aircraft parts plant frantically ran for cover after the gunman, dressed in a black T-shirt and camouflage pants, opened fire with a shotgun and a semi-automatic rifle during a morning break.
Nine people were injured, including one critically, in the United States' deadliest workplace shooting in 2 1/2 years.
Authorities identified the shooter as Doug Williams, a man some employees described as a "racist" who didn't like blacks.
"When I first heard about it, he was the first thing that came to my mind," said Jim Payton, a retired plant employee who worked with Williams for about a year.
He said Williams had talked about wanting to kill people. "I'm capable of doing it," Payton quoted Williams as saying.
One of those killed was Lanette McCall, a black woman who had worked at the plant for 15 years. Her husband, Bobby McCall, said she expected Williams to harm someone someday.
"She said he made a threat against black people," a distraught McCall said.
Nevertheless, Sheriff Billy Sollie said it appeared Williams fired at random with the shotgun and a semiautomatic rifle. "There was no indication it involved race or gender as far as his targets were concerned," Sollie said.
In his truck, parked outside the plant, investigators found yet another rifle, reports CBS News Correspondent Mark Strassman. Authorities said Williams was carrying a .223-caliber semiautomatic rifle when he entered the plant, but he apparently only used the 12-gauge shotgun. He also had three other small-caliber guns in his truck.
Exactly what set Williams off was not immediately clear. The sheriff said he had no information on whether the gunman had been in trouble with his bosses. He said Williams had attended a meeting Tuesday morning with other employees, some of whom were later shot.
"We are not sure if those killed were friend or foe," the sheriff said.
Booker Steverson was helping assemble airplane parts at the plant when he heard the first shot.
"At first I thought it was something falling on the ground. Then I walked to the aisle and saw him aiming his gun. I took off. Everybody took off," he said.
Steverson said Williams was known as a racist who did not like blacks.
The shooting stunned residents of Meridian, whose economy is largely dependent on the military. It is home to the Lockheed plant, a naval air station and an Air National Guard training center.
"We know one another, almost everyone knows someone who works in the building, or has a relative who works in the building," said Craig Hitt, president of the Lauderdale County Board of Supervisors.
The Rev. Kathy Spells pleaded for racial unity the city mourns its losses. "It's time to get together and pray and get this racist thing over with," Spells said.
It was the nation's deadliest workplace shooting since a software tester in Wakefield, Mass., killed seven people the day after Christmas in 2000.
Officials at the Meridian plant declined to comment, and a Lockheed Martin national spokeswoman was unable to immediately provide details.
Gov. Ronnie Musgrove said: "Mississippi's family grieves today for this senseless tragedy. My thoughts and prayers are with the families and friends of those lost."
About 150 people work at the Meridian plant, which builds parts for C-130J Hercules transport planes and vertical stabilizers for F-22 Raptor fighter jets.
Lockheed Martin is the biggest defense contractor in the United States. The corporation had sales of $24 billion in 2001. It employs about 125,000 people.
The dead were identified as Lanette McCall, 47, of Cuba, Ala; Micky Fitzgerald, 45, of Little Rock, Miss.; Sam Cockrell, 46, of Meridian, Miss.; Thomas Willis, 57, of Lisman, Ala.; and Charlie Miller, 58, of Meridian, Miss.