Police arrested a man who carried a rifle into a mental health clinic in Vancouver on Monday intending to be shot to death by police.

The incident happened just after 10 a.m., said Sgt. Duncan Hoss, a spokesman for the Clark County Sheriff's Office.

The man, later identified as Gregory Castro, 39, of Vancouver, walked into the clinic on the third floor of the building, located at 14508 N.E. 20th Ave., with a rifle and asked for a doctor. The physician, who was with a patient, told everyone to leave the building.

Hoss said Castro, a patient at the clinic, planned on being killed by police. A SWAT team was called and the 20 to 30 people in the building at the time were evacuated. Hoss said the doctor stayed with the patient while police negotiated with him.

Castro ended up following police instructions and left the building peacefully, Hoss said. The situation was resolved in 45 minutes.