A man is in critical condition after being shot in a drive-thru of a Brooklyn McDonald’s, police said.

The victim, who has not been identified, was sitting in a car with someone else at the fast-food chain on Pennsylvania Avenue near Linden Boulevard in East New York just before 4 p.m. on Monday when someone walked up and fired several rounds into the vehicle, according to cops.

The car then took off, driving a few blocks away before someone inside called 911, police said.

The victim was hit in the back and arm, police sources told The Post. He was taken to Brookdale University Hospital Medical Center, according to authorities.

Three shell casings were found at the scene, sources said.

It is not known if the second person in the vehicle was injured.

No arrests have been made.