TUSCALOOSA, ALA., FEB. 2 -- State troopers wrestled a gunman to the ground outside West End Christian School tonight as he released his 27 remaining hostages after a day-long siege in which he said he hoped to help the homeless and hungry.

The hostages, 26 third- and fourth-graders and a teacher, emerged single file from the one-story prefabricated metal building that houses the elementary grades and went to the gym. Their parents, who had spent the evening waiting on bleachers, cheered and cried.

The gunman, one of two men in ski masks who entered the school about 8:40 a.m., was identified as James L. Harvey, 43, of San Antonio, a Vietnam-era veteran with a history of mental illness. The gunman's unidentified accomplice, who had carried three rifle cartridges, surrendered to Tuscaloosa police officers in midafternoon.

Authorities said Harvey gave up about 8:30 p.m. after seeing a brief videotape of Gov. Guy Hunt (R), but they would not disclose the tape's contents. A Tuscaloosa police officer who asked not to be identified said Harvey believed he was going to a news conference, as part of the release agreement, when four or five state troopers tackled him.

It was unknown tonight why Harvey targeted the school run by West End Baptist Church, which stands next door. More than 50 of the 80 students and five teachers in the elementary-school division when the siege began had been released earlier in the day.

Park Wilson, 9, said his third-grade class was reading its Bible storybook when the gunman entered the classroom. "He threatened Todd {a classmate} and said, 'You're going to tell the teacher there's somebody here to see her'. . . . The teacher started screaming. I thought she might have an ex-husband."

Park, among the last 27 hostages released, said his class spent the day playing games. The gunman, he said, "had two .357 Magnums. He had a 30-06 Browning, he had a machine gun in his hands all day. He said it weighed seven pounds. He said it had 30 bullets and it could shoot all the bullets in 3 1/2 seconds . . . . The black guy {the accomplice} didn't say a word."

Negotiators, including two reporters, talked intermittently with the remaining gunman through a classroom door. In late afternoon, he said he would release his hostages once a videotape of Hunt signing a pardon for him was delivered.

Jeremy Rhone, 9, a fourth-grader whose father is the assistant headmaster, said the tape showed the governor saying that "he pardoned this guy. He signed a paper and he said, 'This is the paper that pardons you.' He held it up to the camera and put it back on his desk. It lasted about a minute."

Birmingham television reporter Dan Cates, who spoke to Harvey throughout the day, said an FBI agent told him that Hunt carefully qualified his message.

Hoyt Harwell of the Associated Press spoke to Harvey this afternoon for about 10 minutes as Harvey stood in a classroom doorway. Harwell described him as slight with a graying beard "and an unsettling way of gesturing fiercely with his left hand while his right hand held a rifle pointed above my head."

Harwell said Harvey told him: "There are people on the street who don't have a place to sleep or anything to eat. I'm doing this for them. Things are awfully wrong and nobody is doing anything about it. That's why I'm doing this."

School principal Dan Carden said he learned of the crisis when "a student came in and said there was a stranger in the building, and the football coach and I went over to check it out. When we walked in and saw the guy with a gun, we got out of there and called the police. I thought it was a toy at first. I thought it was plastic."

The sixth-graders had gone to breakfast at a fast-food restaurant, and the second-graders escaped through a door to the outside, Carden said. Those who remained were third- and fourth-graders.