Hours later, people were still believed buried under the rubble of the flyover with several cranes being deployed to lift the concrete girder that crashed around 4 pm on the road that leads to the Varanasi-Allahabad highway.
The district administration said nine people were injured, but unofficial reports put the number at about 20.
A mini bus and four cars came under the slab, officials said. Eight to 10 two-wheelers were also trapped, Director General of Police OP Singh told PTI.
Local residents said cyclists and pedestrians also use the stretch of the road about 100 metres from the Varanasi Cantonment railway station.
Uttar Pradesh Relief Commissioner Sanjay Kumar said 18 bodies were pulled out.
Five National Disaster Response Force (NDRF) teams, with about 250 personnel, rushed to the accident site.
An NDRF official said at least three people were rescued. Rescue workers used metal cutters to free people caught in their vehicles.
The Uttar Pradesh State Bridge Corporation Ltd is building the 2,261-metre bridge at a cost of Rs 129 crore, officials said. The span which fell was laid barely three months ago, they added.
Chief Project Manager H C Tiwari and three others were suspended late on Tuesday. Authorities said no work was going on when the concrete slab crashed.
Prime Minister Narendra Modi, who represents Varanasi in the Lok Sabha, expressed grief over the deaths while the opposition targeted the UP government over the tragedy in the "top-priority constituency of the country".
The tragedy is similar to the flyover collapse in Kolkata two years back when over 25 people were killed.
Uttar Pradesh Chief Minister Yogi Adityanath announced a three-member committee to probe into the accident and give its report within 48 hours.
Deputy Chief Minister Keshav Prasad Maurya headed for Varanasi from Lucknow, an official spokesperson said.
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. Spoke to officials and asked them to ensure all possible support to those affected," Modi tweeted.
In another tweet, the prime minister said he had spoken to Adityanath. "The UP Government is monitoring the situation very closely and is working on the ground to assist the affected," he said.
Vice President M Venkaiah Naidu, Governor Ram Naik and Union Home Minister Rajnath Singh condoled the deaths.
Opposition Samajwadi Party chief Akhilesh Yadav attacked the state government, suggesting that corruption led to the tragedy.
"This is the reality of development in the top-priority constituency of the country. The ministers of the state used to visit this district for regular inspections. Is this incident an accident or result of corruption? This should be told to the people of Varanasi by the state government," the SP chief said.
Yadav appealed to his party workers to cooperate with the administration in relief and rescue operations. The accident should be probed "honestly", he demanded.
The state government probe will be headed by Agriculture Production Commissioner Raj Pratap Singh and will include Irrigation Department head Bhupendra Singh and Jal Nigam MD Rajesh Mittal, Principal Secretary (Home) Arvind Kumar said.
(With inputs from PTI)