DEKALB, Illinois (CNN) -- A gunman dressed in black stepped from behind a curtain at the front of a large lecture hall at Northern Illinois University on Thursday and shot 21 people, five of them fatally, then shot and killed himself, said university president John Peters.

Four died at the scene, including the shooter, and two later died at the hospital, he said.

At least 22 people, including a graduate student who was teaching an ocean sciences class, were shot, Peters said.

Seventeen victims were taken to Kishwaukee Community Hospital, its Web site said.

Of those, six were in critical condition and were flown to other hospitals. One fatality, a male, was confirmed -- but was not the gunman, the hospital said. Two were admitted, and three others were discharged. The other five were not addressed on the Web site.

Four of the fatalities were female, said Peters.

Most of the injuries are head and chest gunshot wounds, a hospital spokeswoman told CNN.

The gunman started shooting from a stage in the room shortly after 3 p.m. (4 p.m. ET) in Cole Hall, officials said.

Police Chief Donald Grady said authorities do not yet know of a motive.

They know the identity of the gunman but have not released his name, Grady added.

The shooter was a graduate student at NIU in the spring of 2007. Currently he was not enrolled there but, Grady said, "He may have been a student elsewhere."

Kevin McEnery said he was in the classroom when the gunman, dressed in a black shirt, dark pants and black hat, burst in carrying a shotgun. See photos of the scene »

"He just kicked the door open, just started shooting," said McEnery, who was in the class at the time. "All I really heard was just people screaming, yelling 'get out.' ... Close to 30 shots were fired." Watch a student describe the chaos at the scene »

There are about 162 registered students in the class that met in the large lecture hall.

A student described the classroom as having four exits - two at the front and two at the rear. "Witnesses say someone dressed in black came out from behind a screen in the front of the classroom and opened fire with a shotgun," Peters said.

At 3:03 p.m., NIU police responded, and four minutes later, the campus was ordered into "a lockdown situation," Grady said.

At 3:20, an all-campus alert went out via the campus Web site, e-mail, voice mail, the campus crisis hotline, the news media and various alarm systems, he said.

Don't Miss WQAD: See local coverage of shooting

WQAD: See local coverage of shooting WLS: More local coverage of shooting

"The message basically was: There's a gunman on campus, stay where you are, make yourself as safe as possible," he said.

Rosie Moroni, a student at the school, told CNN she was outside Cole Hall near the King Commons when she heard shots coming from the classroom she was heading to.

The shot was followed by "a lot of people screaming," then people ran out the doors yelling, "He's got a gun, call 9-1-1," she said.

"It was complete chaos. It's very scary here right now."

By 4 p.m., DeKalb police had swept the area "and determined there was only one gunman" and that he was dead.

Grady said the man used three guns: a shotgun, a Glock handgun and a small-caliber handgun, and was still on the stage when he turned one of the guns on himself. The small-caliber handgun has not been recovered, he said.

The shooter started with a shotgun, then switched to a handgun, said Grady.

A spokesman for the Bureau of Alcohol Tobacco Firearms and Explosives told CNN that agents were on the scene, and could help trace the weapon or weapons used. Peters said the FBI is processing the crime scene and ATF was interviewing witnesses Thursday.

Events and classes were canceled until further notice, Peters said.

Seven counseling areas were set up throughout the campus, and hotlines were established.

Security around campus was increased in December when police found threats scrawled on a campus bathroom wall that included racial slurs and references to last April's Virginia Tech shootings. Learn about other recent school shootings »

One of the threats said "things will change most hastily" in the final days of the semester.

Peters said there is no evidence that points to a link between the December incident and Thursday's shooting.

Grady said it was unlikely authorities could have prevented Thursday's tragedy. "As much as we do, it's unlikely that anyone would ever have the ability to stop an incident like this from beginning," he said.

Illinois Gov. Rod Blagojevich declared a state of emergency, which will open the governor's disaster fund to reimburse local government entities for "extraordinary expenses related to the response in NIU DeKalb" and will allow the state Emergency Management Agency to provide assistance, the governor's office said in a statement.

The 113-year-old school is 65 miles west of downtown Chicago and has an enrollment of more than 25,000. The campus covers 755 acres. See a map of where the shooting took place » E-mail to a friend

CNN's Kevin Bohn contributed to this report.