The explosion in the underground pipeline caused a huge hole to appear in the roadway above and state television showed a truck that had fallen into it, with a residential apartment block in the background.
The local government said on its microblog that the blast happened at 10:30 a.m. (0230 GMT) as workers were trying to repair leaks in the pipeline. It said oil had spilled into the port, which had also caught fire.
Ship brokers said Qingdao oil terminal had stopped operations.
Qingdao is one of China's largest crude oil import terminals, supplying at least two major Sinopec refineries -- the Qingdao plant and Sinopec Qilu Petrochemical Corp -- as well as many small, independent refineries.
"Early investigations showed the spilled oil flowed into the municipal grid, which caused the explosion," the local government said, giving no further detail on the grid. It said the oil spill had spread across 3,000 square metres of sea water.
Sinopec confirmed on its microblog that the explosion was caused by a leak in the Huangwei crude oil pipeline. It said the fire was put out at 1 p.m.
Company officials could not immediately be reached for comment and it was unclear if there was any impact on the 240,000-barrel-per-day Sinopec Qingdao refinery, which receives imported crude oil cargoes from the nearby Huangdao port.
The affected crude oil pipeline connects Huangdao to the city of Weifang in the same province, Shandong.