BELLINGHAM, Mass. (AP) _ A spree of terror in this rural community that included the invasion of homes by rifle-toting bandits who cut telephone wires and seized teen-age girls has ended with the arrest of two men, authorities said.

Police said one of the pair is the son of a man convicted in 1983 of killing the youth's mother and her lover.

The latest attack occurred early Monday, when two gunmen dressed in combat fatigues bound, gagged and forced a 15-year-old girl from her bedroom as her parents slept, police said.

The girl was held by her captors for almost 24 hours and released early Tuesday. Authorities said she was raped and Detective Paul Farrell said she was lucky to be alive. ''She came through it well,'' he said.

The girl's parents reported her missing from the house after they were awakened by their screaming 10-year-old daughter. Police found that phone lines to their house had been cut.

Joseph L. Allen Jr. and Richard C.A. Babcock Jr., both 18, were arrested early Tuesday, about an hour after the girl was freed.

Authorities said their car was stopped because it had a noisy muffler and officers saw a .22-caliber rifle in the car along with several rolls of the kind of tape the girl was bound with.

The two were charged with kidnapping, aggravated rape and two counts of armed assault in a dwelling.

The charges of armed assault in a dwelling resulted from an incident Saturday in nearby Mendon and another Sunday at a house down the street from the home of the girl abducted on Monday. Bellingham is about 30 miles southwest of Boston.

In the Bellingham incident, a 17-year-old boy was briefly held captive with a handgun, police said.

The Mendon incident involved the foiled abduction of another girl from her home. An intruder broke into a house early Saturday, and held a gun to the 16- year-old girl's head, said Mendon Police Lt. Dennis Grady.

When her mother returned home, the girl shouted a warning. As her mother returned to her car, the girl jumped out a window. The mother and daughter sped from the house.

District Judge Francis J. Larkin on Tuesday ordered Allen and Babcock held at a state mental hospital for 20 days to determine their competence to face the charges.

''I feel that both of these young men have significant psychological problems,'' Dr. James Robison, a court psychiatrist who examined the pair, told Larkin in recommending further evaluation.

Authorities said Allen's father, Joseph L. Allen Sr., is serving two concurrent life sentences for the 1982 murders of his estranged wife Nancy and a male friend.

After killing the couple, Allen shot himself in the head in an unsuccessful suicide attempt.

The next day, his son, then 15, found the bodies and his critically injured father. He later testified at the murder trial of his father, who suffered brain damage in the shooting.

Police said they believe the attacks were random and the assailants did not know their victims, although all three alleged victims and Allen attend the same school, Blackstone Valley Regional Vocational and Technical High School.

Police said Allen and Babcock might also be charged with dozens of other crimes, ranging from vandalism to housebreaks, in surrounding towns.

Search warrants executed at Allen's apartment and car Tuesday turned up additional evidence, including a hand-held BB-gun, Bellingham police said.