The man was walking on the A75 between Annan and Dumfries shortly before midnight on Sunday when he was hit by a Vauxhall Insignia.
Police said he was pronounced dead at the scene and the people in the car were taken to hospital as a precaution.
A Police Scotland spokeswoman said: “Officers were called to the A75 between Annan and Dumfries, close to the turning for the B7020, at around 11.50pm on Sunday 29 August 2021 following a crash between a pedestrian and a car.
“Emergency services attended; however, the male pedestrian was pronounced dead at the scene.
“The occupants of the car, a Vauxhall Insignia travelling east, were taken to hospital as a precaution.
“The roadway reopened at around 7.35am and inquiries are ongoing into the crash.
“Anyone with information is asked to contact Police Scotland via 101 and quote incident number 4724 of 29 August.”