A man was seriously injured Friday when a car came out of nowhere and smashed into him as he walked along a sidewalk in Queens.

Dramatic video shows the white Jeep Cherokee, driven by an elderly man, suddenly picking up speed and mounting the sidewalk on busy Steinway Street in Astoria after pulling out of a parking space.

After hitting the pedestrian, it crashed into the wall of a radiology center.

Dr. N.D. Wruble, who works at the center, rushed outside.

He recognized the driver — whom he had examined only minutes earlier.

The patient told the doctor that the accelerator pedal had become stuck on the floorboard.

A hairstylist working at a salon next door to the imaging center said: “It sounded like an explosion. At first we thought it was a bomb.”

Another witness, Robert Arena, said patients at the facility spilled onto the street to see what had happened.

“People were walking outside in their robes,’’ he said.

“Everybody was stunned.’’

Arena, a lawyer whose office is across the street, said the injured man was bleeding from the side of his head, — but said he felt OK.

Real-estate broker Liz Finnerty, whose cousin owns the building housing the medical office, said it could have been a lot worse.

“The exterior wall is not made of cinder blocks,” she told The Post.

“It’s made of softer material that gave way, and I think that saved [the driver’s] life.”

The driver was taken to Elmhurst Hospital in serious condition. Police were trying to determine what caused the accident. No arrests were made.