A Philadelphia judge has dismissed ­criminal charges against Brandon Bostian, the engineer operating the Amtrak train that derailed and killed eight people, injuring dozens more in the Port Richmond section of the city in 2015.

Judge Thomas Gehret dismissed the charges against Bostian at a hearing Tuesday, ruling that there wasn't enough evidence to show a crime had been ­committed, the state Attorney General's Office confirmed.

“The Amtrak crash was a tragedy and this case has a unique procedural history. We are carefully reviewing the judge's decision, notes of testimony and our prosecutorial responsibilities in this case going forward,” Attorney General Josh Shapiro said in a statement Tuesday afternoon.