A University of Maryland graduate student shot his two roommates, one fatally, early Tuesday before killing himself outside the house they shared near the College Park campus, the authorities said.

In addition to a handgun that the police say was used in the shootings, officers found a bag of weapons near the gunman’s body — including a loaded semiautomatic weapon that was not used in the attack, a machete and a baseball bat.

The police said that just before 1 a.m., the student, Dayvon Green, 23, set several small fires in the basement and the backyard of the house, which is about a block from campus.

When his roommates, both 22-year-old students, woke up, they persuaded Mr. Green to help them extinguish the fires, said Julie Parker, a spokeswoman for the Prince George’s County Police Department.