HEWLETT, N.Y. (AP) -- A U.S. Naval Academy midshipman killed in this week's Amtrak derailment was remembered Friday as a rising star who inspired others and "put everyone before himself."

U.S. Navy midshipmen salute as the casket carrying the remains of U.S. Naval Academy midshipman Justin Zemser passes during his funeral service (AP Photo/Mary Altaffer)

Classmates of Justin Zemser's from the academy in Annapolis, Maryland, joined family members and students from Zemser's New York City high school for the 20-year-old's funeral on Long Island.

"Justin was truly a phenomenal young man, one of our top-performing midshipmen," said Zemser's commanding officer, Capt. Brandy Soublet. "But not only was he top-performing, he was just a man of immense character."

Soublet spoke outside the Boulevard-Riverside-Hewlett Chapel on Long Island before Zemser's funeral began.

The sophomore was traveling from the academy to his home in the Rockaways section of Queens when he was killed in Tuesday's derailment in Philadelphia. He was one of eight people killed.

U.S. Naval Academy Midshipman Justin Zemser .(U.S. Naval Academy via AP)

Aurora Perez, 17, who was a freshman at Beach Channel High School when Zemser was a senior there, said Zemser often returned to the school and spoke to students.

"He just told everyone to, you know, reach for the stars and never give up on your dreams," she said.

Perez said everyone at Beach Channel looked up to Zemser, including teachers.

"He was loving, caring," she said. "He put everyone before himself. ... He just cared about other people instead of his own life. If he could save anyone on that train, I know he would have."

Zemser was a member of the Navy sprint football team, the Jewish Midshipman Club and the Semper Fi Society, a Marine Corps club.

(© 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)