BOSTON — Boston Marathon suspect Dzhokhar Tsarnaev downloaded bomb-making instructions from an al-Qaida magazine, gathered online material on Islamic jihad and martyrdom, and later scrawled anti-American messages inside the boat where he lay wounded, a federal indictment charged Thursday.

The 30-count indictment contains the bombing charges, punishable by the death penalty, that were brought in April against the 19-year-old Tsarnaev, including use of a weapon of mass destruction to kill.

It also contains many new charges covering the slaying of an MIT police officer and the carjacking of a motorist during the getaway attempt that left Tsarnaev’s older brother, Tamerlan, dead.

“Tamerlan Tsarnaev’s justice will be in the next world, but for his brother, accountability will begin right here in the district of Massachusetts,” Suffolk District Attorney Daniel Conley, whose jurisdiction includes Boston, said at a news conference with federal prosecutors.

The indictment provides one of the most detailed public explanations to date of the brothers’ alleged motive — Islamic extremism — and the role the Internet may have played in influencing them.

Three people were killed and more than 260 wounded by the two pressure-cooker bombs that went off near the finish line of the marathon on April 15.

Dzhokhar Tsarnaev was captured four days later, hiding in a boat parked in a backyard in Watertown, Mass.

According to the indictment, he scrawled messages on the inside of the vessel that said, among other things, “The U.S. Government is killing our innocent civilians,” “I can’t stand to see such evil go unpunished,” and “We Muslims are one body, you hurt one you hurt us all.”

The Tsarnaev brothers had roots in the turbulent Russian regions of Dagestan and Chechnya, which have become recruiting grounds for Muslim extremists. They had been living in the U.S. about a decade.