COLORADO SPRINGS, Colo. - The gunman believed to have killed four people at a megachurch and a missionary training school had been thrown out of the school a few years ago and had been sending it hate mail, police said in court papers yesterday.

The gunman was identified as Matthew Murray, 24, who was home-schooled in what a friend said was a deeply religious Christian household. Murray's father is a neurologist and a leading multiple-sclerosis researcher.

Five people - including Murray - were killed, and five others wounded Sunday in the two eruptions of violence 12 hours and 65 miles apart.

The first attack took place at Youth With a Mission, a training center for missionaries in the Denver suburb of Arvada; the other occurred at the New Life Church in Colorado Springs, where Murray was shot by a security guard, Jeanne Assam, though investigators said he may have died from a self-inflicted gunshot wound.

Colorado Springs police said the "common denominator in both locations" was Youth With a Mission. The training center maintains an office at the 10,000-member church.

"It appears that the suspect had been kicked out of the program three years prior and during the past few weeks had sent different forms of hate mail to the program and-or its director," police said.

In a statement, the training center said health problems kept Murray from finishing the program. It did not elaborate.

Police gave no immediate details on the hate mail.

Investigators have not said whether Murray singled out his victims. But the two people killed at the church - sisters Stephanie and Rachael Works, ages 18 and 16 - frequented the training center, their uncle Mark Schaepe of Lincoln, Neb., told the Gazette of Colorado Springs.

Murray's father, Ronald S. Murray, is chief executive of the Rocky Mountain Multiple Sclerosis Center in Englewood, where Matthew Murray lived along with a brother, Christopher, 21, a student at Oral Roberts University in Tulsa, Okla.

A neighbor, Cody Askeland, 19, said the brothers were home-schooled, describing the family as "very, very religious."

Police said Murray's only previous brush with the law was a traffic ticket earlier this year.

Senior Pastor Brady Boyd, of New Life Church, said the gunman had no connection to the church.

"We don't know this shooter," Boyd said yesterday. "He showed up on our property yesterday with a gun with the intention of hurting people, and he did."

The gunman opened fire at 12:30 a.m. at the Youth With a Mission center. Witnesses said the man asked to spend the night there and opened fire with a handgun when he was turned down. They described him as a young man, perhaps 20, in a dark jacket and cap.

Later, at New Life Church, a gunman wearing a trench coat and carrying a high-powered rifle opened fire in the parking lot and later walked into the church as a service was letting out.

Assam, a church member who volunteers as a security guard, shot Murray, who was found with a rifle and two handguns, police said.

Assam said she believes God gave her the strength to confront Murray, keeping her calm and focused.

"It seemed like it was me, the gunman and God," she said at a news conference.

Boyd said the gunman had a lot of ammunition and estimated that 40 rounds had been fired inside the church, leaving what looked like a "war scene."

About 7,000 people were in and around the church the time of the shooting, Boyd said.

Security had been beefed up after the shootings hours earlier in Arvada, he said.

The church had 15 to 20 volunteer security officers inside at the time of the attack, he said.

New Life, with a largely upper-middle-class membership, was founded by the Rev. Ted Haggard, who was dismissed last year after a former male prostitute alleged he'd had a three-year cash-for-sex relationship with him. Haggard admitted committing unspecified "sexual immorality."

The two people killed at the missionary center were identified as Tiffany Johnson, 26, and Philip Crouse, 24. Johnson, who grew up in Chisholm, Minn., loved working with children and wanted to see the world, said family friend Carla Macynski.

Crouse, of Alaska, was a former skinhead who went through a dramatic spiritual conversion at 18. He had helped build a foster home at a Crow Indian reservation in Montana, said Ronny Morris, who works with a Denver chapter of the mission. *