NEWINGTON, Conn. (AP) _ A disgruntled employee opened fire at state lottery headquarters today, killing three workers before chasing the lottery chief into a parking lot and gunning him down. The gunman, an accountant, then fatally shot himself.

Matthew Beck, an eight-year lottery employee who had returned from medical leave Feb. 25, had filed a grievance in August claiming he had been given a job outside his work classification.

Beck, 35, was working in the building before the shooting began around 8:45 a.m. He killed three people inside, then ran outside, where other workers had fled.

Beck apparently singled out lottery president Otho Brown, chasing him about 100 yards before shooting him in the parking lot.

``He came in with a gun and lots of ammunition. He was heavily armed,'' said Master Sgt. Gregory Chelso of the state police.

Beck shot himself as police closed in on him, Public Safety Commissioner John Connelly said. He died at Hartford Hospital.

``Yes, he has been troubled, but I don't want to talk to you right now,'' his father, Donald Beck, said when called by The Associated Press.

Also among the victims was Linda Mlynarczyk, the lottery's chief financial officer and a former one-term mayor of New Britain. The other two victims were Rick Rubelmann, vice president of operations, and Michael Logan, a data processor.

``This morning, four devoted public servants were killed ... The whole state mourns this unexplained act of violence,'' Gov. John G. Rowland said.

There was no armed security at the building, where 115 state workers are employed. It is unclear how many were in the building at the time of the shooting.

When Beck began firing, Brown, 54, and other employees fled outside and scattered toward nearby woods.

``The security guy ... told everybody to run into the woods,'' one woman told television reporters. ``We all took off for the woods ... and we heard gunshots.''

A 45-year-old man suffered a head injury as he jumped onto a moving vehicle while he was trying to get out of Beck's way, Hartford Hospital spokesman James Battaglio said.

After the shooting, police blocked off the area surrounding lottery headquarters, about 10 miles south of Hartford. Brown's body was covered in canvas and remained on the ground for several hours after the shooting.

Lottery employees were put on school buses and questioned, then taken to Town Hall, where they met with a priest and Rowland.