MADISON, Wis. -

A judge has ruled that a Madison man who police say purchased an assault rifle and threatened to kill his neighbors and one of his friends is not competent to stand trial.

Andrew J. Meis, 20, is accused in a plot to kill two Madison residents: a 54-year-old woman and a 21-year-old man.

A doctor testified Friday in Dane County Court regarding Meis’ mental health and said Meis was not competent to stand trial. A judge agreed.

Meis is charged with two counts of attempted first-degree intentional homicide.

Meis informed his psychiatrist he was going to kill his neighbors and one of his friends, according to a criminal complaint.

The complaint details a confrontation in December 2011, when police said Meis knocked on a neighbor's door while carrying a gun.

Police said an AK-47 rifle and ammunition were recovered from Meis' home in the 4700 block of Hayes Road. Police said Meis was apprehended before any shots were fired.