A Johns Hopkins University student armed with a samurai sword killed a suspected burglar in a garage behind his off-campus home early Tuesday, hours after someone broke in and stole electronics.

Some shocked neighbors said they heard bloodcurdling screams in an area just blocks from the university. Police held the student, a junior chemistry major who turns 21 on Sunday, for several hours, but no charges were filed by early afternoon, said police spokesman Anthony Guglielmi.

Around 1:20 a.m., the student heard noises behind the home and noticed a door to the garage was open, Guglielmi said. He grabbed the sword and confronted the intruder — identified by police as Donald D. Rice, 49, a habitual offender who had just been released from jail.

Rice was crouching beneath a counter, police said. The student asked him what he was doing and threatened to call police.

"When he said that, the suspect lunged at him, kind of forced the kid against the wall, and he struck him with the sword," Guglielmi said.

‘Hanging on by a thread’

Rice's left hand was nearly severed — Guglielmi described it as "hanging on by a thread" — and he suffered a severe cut to the upper body. He died at the scene.

Video: Man kills burglar with samurai sword On Monday, two laptops and a Sony PlayStation were stolen from the student's home, which he shares with three other students, but police were not sure whether Rice was responsible, Guglielmi said.

There was a pool of blood Tuesday morning in the brick courtyard between the back porch of the home and the garage. The courtyard was strewn with debris, including what looked like broken glass.

Guglielmi did not know why the student kept a sword. He said he may have had some martial arts training, but was not an expert.

Rice's criminal history includes more than two dozen arrests for burglary, breaking and entering and auto theft. According to court records, he was charged in 2007 after he pulled a gun on a police officer, though prosecutors placed those charges on hold because the officer was on military leave.

Rice was convicted in 2008 of unauthorized removal of property and sentenced to 18 months. He was released Saturday from the Baltimore County Detention Center.

Several nearby residents said the community has experienced a rash of petty crimes in recent months, including home, garage and vehicle break-ins. Many homes have bars on windows and stickers advertising alarm systems.

‘I could tell someone was scared’

Michael Hughes, 43, said he was getting ready for bed when he heard the screams.

"There was fear in the voice. I could tell someone was scared," Hughes said.

Hughes called 911, and several police cars arrived while he was on the phone. Campus security officers and an off-duty city officer who were in the area responding to a suspicious person report also heard the screams.

The diverse neighborhood includes a mix of students, professors and families, said Hughes, who lives with his wife and young children and works for the Johns Hopkins Bloomberg School of Public Health, which is on another campus across town.

"There seems to be a noticeable increase in crime in the neighborhood," Hughes said. "I am concerned for my family's safety."

Tension between students, residents

Kenny Eaton, 20, a junior political science major at Hopkins who lives nearby, said there was some tension between students and lower-income residents of nearby communities. The private Johns Hopkins is known for its health and science research and has about 4,600 undergraduates on its main campus.

"You take kids who are paying $50,000 a year (in tuition) and then put them out in a very dangerous city environment, it's almost like a clash of civilizations," he said.

Three young men, including one in a Hopkins T-shirt, were sitting on the front porch of the home Tuesday morning. A police officer was standing in the doorway, and a single police car was parked nearby. The men refused to talk to an Associated Press reporter.

Student was not harmed

Susan Boswell, the dean of student life at Hopkins, said in a statement that she was "relieved to report that the student was not harmed," but she also advised other students not to follow the swordsman's example.

"If you ever suspect that there is a prowler in your residence or on your property, call 911 immediately," Boswell said. "Experts advise that you do not attempt to confront the intruder, but rather secure yourself in a locked area until police arrive."

As in most states, self-defense in Maryland is defined by common law rather than by statute. People who confront intruders inside their homes have a greater degree of latitude to use force, and prosecutors consider whether to file charges in such incidents on a case-by-case basis.

"One can genuinely and reasonably be in fear of one's own safety even if the burglar is unarmed," said Andrew D. Levy, a Baltimore defense attorney and an adjunct professor at the University of Maryland School of Law. "But nonetheless, it would be something that a good prosecutor would consider."