KARLSRUHE, Germany — A Moroccan man was convicted Thursday of acting as an accessory to murder in the Sept. 11, 2001 terror attacks by a federal appeals court that ruled that he played a direct role in the plot.

Mounir El Motassadeq was a close friend of hijackers Mohamed Atta, Marwan al-Shehhi and Ziad Jarrah when they lived and studied in the northern port city of Hamburg.

The Federal Court of Justice found that a Hamburg court decided wrongly last year to acquit el Motassadeq of direct involvement in the attacks, even as it convicted him of membership in a terrorist organization and sentenced him to seven years in prison.

It ordered the Hamburg court to reconsider his sentence. El Motassadeq could now face a maximum 15 years in prison.

“The defendant is guilty not only of membership in a terrorist organization, but also as an accessory to murder of the 246 passengers and crew members of the crashed aircraft,” the federal court said in its ruling.

In his ruling, Presiding Judge Klaus Tolksdorf said the evidence showed el Motassadeq knew the plotters planned to hijack and crash planes, and said it was irrelevant to his guilt whether he knew of the planned timing, dimension or targets of the attacks.

Tolksdorf said the evidence showed that el Motassadeq, 32, helped “watch the attackers’ backs and conceal them” by doing things such as helping them keep up the appearance of being regular university students — paying tuition and rent fees and transferring money.

“We won, I’m ecstatic,” Dominic Puopolo Jr., an American co-plaintiff whose mother died in one of the planes that struck the World Trade Center, told The Associated Press by phone from South Beach, Fla.

“This man’s actions as a coconspirator caused thousands upon thousands of families untold grief, and to know that the German justice system has worked — it’s a tremendously special day,” Puopolo said.