BOSTON — The Justice Department said the man identified as the shooter who killed two Brown University students and an MIT professor planned the attacks for years and left behind videos in which he confessed to the murders but gave no motive.

U.S. officials said Tuesday that Claudio Neves Valente, 48, was found dead in a New Hampshire storage facility after he killed two Brown students and wounded nine others in an engineering building on Dec. 13. Two days later, authorities said, he fatally shot MIT professor Nuno F.G. Loureiro in his home in the Boston suburb of Brookline.

During the search of the storage facility where Valente’s body was found on Dec. 18, the FBI recovered an electronic device containing a series of short videos made by Valente after the shootings, the Justice Department said. In the recordings, translated into English for an announced transcript, Valente admitted in Portuguese that he had been working out details for at least six semesters, officials said.

The Justice Department said Valente did not provide a motive for targeting Brown or Loureiro, with whom he attended school in Portugal decades ago. In the translated transcript, Valente said he felt he had nothing to apologize for and addressed what he described as misinformation about the attack.

“I’m not going to apologize because during my lifetime no one sincerely apologized to me,” Valente said in the videos, according to the English-translated transcript provided by the Justice Department. The Justice Department information also said Valente responded to claims spread by conservative influencer Laura Loomer after the attack that he had spoken in Arabic when he entered a Brown auditorium, including claims that he said “Allahu akbar.”

Valente said he did not speak a word of Arabic or intend to make any kind of statement. If he had said anything, he told investigators he must have made an exclamation such as “Oh no!” or similar disappointment at the auditorium appearing empty when he entered.

The Justice Department information said Valente described students hiding under desks, but that he believed they had already escaped through an emergency exit. He also said he never wanted to carry out the attack in an auditorium and that he had “plenty of opportunities,” especially “this semester,” but that he did not act.

“I always chickened out,” Valente said in the recordings, according to the translated transcript. In the videos, the Justice Department information said, he insisted he was not mentally ill and said he did not want to be famous and that the video was not a manifesto.

Valente described his “only objective” as leaving “more or less” on his “own terms,” and said he wanted to ensure he “wouldn’t be the one who ended up suffering the most from all this.” He added: “No, that cannot happen. So if you don’t like it, tough luck,” according to the translated transcript. The Justice Department said he called his execution of the murders “a little incompetent” but said that “at least something was done.”

The Justice Department information identified the Brown students killed in the Dec. 13 attack as sophomore Ella Cook, 19, and 18-year-old freshman MukhammadAziz Umurzokov. It said Valente wounded nine other people in the Brown attack before killing Loureiro two days later.

Authorities said Valente and Loureiro attended the same academic program in Portugal between 1995 and 2000. The Justice Department information said Loureiro graduated from the physics program at Instituto Superior Técnico in 2000, citing the MIT faculty page, and it said an archive of a Lisbon university termination notice showed Valente was let go from a position there in February 2000. In the videos, Valente also said he had the storage space where his body was found for about three years.

Brown University said Tuesday that “the gravity of this tragedy continues to weigh heavily on the full Brown University community” and that it continues to mourn the deaths of the two students and pray for the full recovery of those injured.

The Justice Department information said Valente also mentioned a confrontation with a witness at Brown that he said ultimately led to his identification days later. It described police information that the witness had several encounters with Valente before the attack and that, after police posted images of a person of interest, the witness began posting on Reddit theorizing that police should look into “possibly a rental” gray Nissan.

The Justice Department said Reddit users urged the witness to inform the FBI and that the witness did so. It said police stated that until that point, officials had not connected a vehicle to the possible shooter.

In the recordings, Valente said he was confronted and that the witness saw his license plate. “I actually was confronted,” Valente said in the translated transcript, and he added, “I honestly never thought it would take them so long to find me.”

The Justice Department information said Valente told investigators he had no hatred or love for the United States and that he arrived about 25 years ago to study physics at Brown’s graduate program before leaving the spring of 2001. It said he studied at Brown on a student visa and eventually obtained legal permanent residence in September 2017, with his last known residence in Miami. Valente said in the recordings: “It’s the same thing with Portugal, and most of the places where I have been,” and later that “I’ve been here without caring for a very long time now.”