A man who police say walked up to a car in Brooklyn with a rifle, ordered the driver out of the car and then sped away later crashed in South Baltimore.

The carjacking happened about 5 a.m. in the 200 block of Washburn Avenue on Thursday, according to police.

About five hours later, police said, the man crashed the Honda Civic into a tractor-trailer at the intersection of Hanover Street and West Cromwell Street, near the Hanover Street Bridge.

Police said a rifle was recovered from the Honda.

The man, whom police did not identify, was taken to a hospital. Police said he will be charged when he is released from the hospital.