NEW DELHI — A section of an overpass under construction collapsed on a heavily trafficked road in the northern Indian city of Varanasi on Tuesday, killing at least 18 people, the authorities said.

The collapse happened around 6 p.m. and trapped a bus, cars, motorcycles, auto rickshaws and pedestrians underneath the concrete slabs. About 300 soldiers with heavy rescue equipment were on the scene and recovered several bodies from cars and the bus, officials said.

The state government ordered an investigation and announced monetary compensation for the injured, the number of whom was not immediately clear, and for the families of the dead.

Varanasi is a city sacred to Hindus in the state of Uttar Pradesh. It is a political base of Prime Minister Narendra Modi, who said in a tweet: “Extremely saddened by the loss of lives due to the collapse of an under-construction flyover in Varanasi. I pray that the injured recover soon.”