Hours earlier, someone had broken into John Pontolillo's house and taken two laptops and a video-game console. Now it was past midnight, and he heard noises coming from the garage out back.

The Johns Hopkins University undergraduate didn't run. He didn't call the police. He grabbed his samurai sword.

With the 3- to 5-foot-long, razor-sharp weapon in hand, police say, Pontolillo crept toward the noise. He noticed a side door in the garage had been pried open. When a man inside lunged at him, police say, the confrontation was fatal.

"He was backed up against a corner and either out of fear or out of panic, he just struck the sword with force," said Baltimore Police spokesman Anthony Guglielmi. "It was probably with fear for his life."

Pontolillo, who rents the house in the 300 block of E. University Parkway in the Oakenshawe neighborhood, struck the intruder no more than twice, police say, nearly severing his left hand and inflicting what police termed a "spear laceration."

The intruder, Donald D. Rice of Baltimore, a 49-year-old repeat offender who had been released from jail only Saturday, died at the bloody scene.

Pontolillo, 20, of Wall, N.J., whose identity was confirmed by law enforcement sources, was released late Tuesday afternoon. Guglielmi said it would be up to the state's attorney's office to determine whether he will be charged in the incident.

In a statement Tuesday, Hopkins officials told students there had been more than a half-dozen burglaries in the area recently, and that police presence would be bolstered.

Diego Ardila, a Hopkins student who lived with Pontolillo in the three-story, five-bedroom house during the summer, said Pontolillo owned a samurai sword and generally kept it in his room. He described Pontolillo as somewhat outgoing, but said they didn't talk a lot.

"You don't expect to hear that someone you know killed a guy with a samurai sword," said Ardila, 19. "From what little I know of him, he wasn't some guy going out to kill."

It is legal to possess a sword in Baltimore, Guglielmi said, and "individuals have a right to defend their person and their property." He declined to comment on whether its use in this case was appropriate.

University of Maryland professor David Gray, who specializes in criminal law, said prosecutors must weigh whether Pontolillo felt his life was in danger or whether he became the aggressor.

In Maryland, Gray said, an individual is not expected to retreat from suspected danger in his own home. But it is unclear how the law applies to an enclosed backyard.

If the student felt he was in danger of severe bodily harm, then he was within his right to protect himself, Gray said: "It doesn't matter if he used a gun, a sword or a frying pan."

The sword police recovered from the scene, with a sharp blade and ribbon-wrapped hilt, is a replica of a historic samurai weapon. Though a real one would cost thousands of dollars, Guglielmi said, this one probably cost a few hundred.

The police spokesman said the student who wielded the weapon had no advanced sword training. "He wasn't a ninja," Guglielmi said. "He may have been moderately trained or on the intermediate level."

Hundreds of varieties of samurai swords are available online to collectors and hobbyists, martial arts enthusiasts and students of swordplay through stores such as Steve Dibble's Japanese Swords 4 Samurai site, based in Birmingham, Ala.

His swords range in price from about $50 for the model called the "Kill Bill," after the violent Quentin Tarantino films, to more than $2,000 for a handmade "Katana" forged of steel, a hilt wrapped in leather and silk, and decorative flourishes of silver.

Midrange swords, the type apparently used in the Baltimore incident, are those likeliest used at martial arts schools, he said, where students want a weapon sharp enough to cut.

To inflict lethal damage requires some skill, Dibble said.

"To be that confident with it that he would go grab it, he may have been into martial arts," he said. "You would have to hold it with two hands and be confident that you would really know what you were doing."

Mantis Swords, an online outlet based in Westminster, specializes in sharp weapons. "Our swords are ready for cutting," owner Shawn Salafia said.

Salafia sells mats that people can soak in water so that when they dry, they'll be roughly the consistency of a person.

"You stick them on a stand, and you cut them," he said. "If someone laid their hand into it, you could probably cut into it pretty darn deep."

By Tuesday afternoon, two pools of blood remained on the ground a few feet away from the door to the garage, which is not connected to the home. A gate in a wooden fence surrounding the backyard was broken, allowing the scene to be viewed from the sidewalk.

Michael Hughes, who lives about a block away in the neighborhood, heard screams early Tuesday.

"I could hear the fear in the voice, and I could tell someone was scared," said Hughes, 43, who works for Johns Hopkins' Bloomberg School of Public Health.

He called police and then walked over to the crime scene.

"The body was near the garage," he said. "I watched them carry the sword out. The whole thing was surreal and totally bizarre."

Rice, of the 600 block of East 26th St. in Baltimore, had 29 prior convictions for crimes such as breaking and entering, Guglielmi said. He had been released Saturday from the Baltimore County Detention Center, where he had been held after his arrest by county police last year for stealing a car in the city. He was found guilty in December of unauthorized removal of property and was sentenced to 18 months in prison.

The incident was the second this week in which a man was wounded trying to commit a robbery. An off-duty Baltimore police officer shot and critically wounded a man who had tried to rob him at gunpoint in his Northeast Baltimore home, according to police. He chased the man for two blocks before opening fire, police said.

Baltimore Sun reporter Justin Fenton contributed to this article.