http://www.cnn.com/2007/US/04/19/gun.laws/index.html NN) -- When Cho Seung-Hui purchased two handguns this year, he apparently followed the letter of the law to get the weapons he eventually used in a shooting rampage on the Virginia Tech campus.Some questions have been raised over Cho's mental health and whether that should have prevented him from being able to purchase the handguns. A Virginia judge in December 2005 deemed Cho "an imminent danger to himself because of mental illness" and ordered outpatient treatment for him, according to court documents. (Watch campus shooting rekindle debate on gun control ) Special Justice Paul M. Barnett, who filled out the certification and order for involuntary admission to a mental health facility, checked the box that said: "The alternatives to involuntary hospitalization and treatment were investigated and deemed suitable." "Only if I order them into a hospital is there any effect on their gun rights," Barnett told CNN on Wednesday. (Read the judge's order - PDF) Virginia and federal law prohibit the sale of guns to anyone who has been sent unwillingly to a mental institution. Police twice investigated Cho in the fall of 2005 after female students complained about his contacts with them, university police Chief Wendell Flinchum said Wednesday. Neither of the women pressed charges. A former suite mate of Cho, who wished to be identified only as Andy, told CNN that Cho had harassed three women and had spoken of suicide after a run-in with police. "I told the cops that. And they took him away to the counseling center for a night or two," the roommate said. The Virginia State Police Web site features a 16-question "Firearms Purchase Eligibility Test." The site says that answering yes to any of the queries means a person may not be able to purchase a firearm. Question 9 states: Have you ever been adjudicated legally incompetent, mentally incapacitated, or been involuntarily committed to a mental institution? Because Cho was not involuntarily committed to a mental institution, his appearance before the judge and his evaluation at a mental health facility did not show up when he bought the guns. Gun buyers are regulated by the laws of the state in which they live. In Virginia, a person 21 or older can buy only one handgun a month, unless he has a license to buy more. Cho bought one gun, a .22-caliber pistol, in early February and another, a 9 mm pistol, in March. Cho bought one of the guns he used in the shootings from an out-of-state dealer, according to Joe Dowdy, the owner of the pawnshop across the street from campus where Cho picked up the Walther P22 pistol on February 9. Under federal law, a weapon purchased from an out-of-state dealer must be shipped to an in-state, federally licensed gun dealer, who runs a background check. The buyer must appear in person to pick up the gun, and the dealer receives a small fee -- usually between $20 and $40 -- for facilitating the pickup. Cho bought a Glock 19 and 50 rounds of ammunition on March 12, staying just within the limit of one gun purchase per month, said John Markell at Roanoke Firearms in nearby Roanoke. Even though Cho is a resident alien, Markell said, it was legal for him to purchase a firearm, and he presented three forms of identification: a driver's license, a checkbook with an address matching the driver's license, and a resident alien card. Cho moved to the United States from South Korea at age 8. State police conducted an instant background check that probably took about a minute, the store owner said. Virginia law requires no waiting period, so Cho was able to legally take home the Glock on the same day that he bought it. Markell, whose daughter graduated from Virginia Tech in 1997, said he was "heartbroken" to find out one of the guns came from his store. But, he said, "There was no reason for me to deny the sale." Criminal defense attorney Daniel Gotlin told CNN he believes the easiest way to prevent similar incidents in the future "is to not make guns so easily available to individuals with problems." "Virginia has one of the easiest gun qualification laws in the whole United States," he said. And Democratic Virginia Rep. Jim Moran said on the House floor: "It is simply too easy to obtain a firearm." But Jacob Sullum of Reason magazine says gun-control laws "disarm the law-abiding people, but they leave the criminals free to attack their victims who have no defense." CNN's Drew Griffin, Jeanne Meserve, Christine Romans and Michael Sevanof contributed to this story.