The blast lit fire to an 18-inch pipeline of state-owned Gas Authority of India Limited (GAIL) near a refinery of the Oil and Natural Gas Corporation (ONGC) in East Godavari district.
"My thoughts with the families of those who lost their lives in the GAIL pipeline fire in Andhra Pradesh. Prayers with the injured," Modi tweeted.
The prime minister said he has spoken to the petroleum minister, the cabinet secretary and the GAIL chairman and has asked them to "ensure immediate relief at the accident site".
The blast took place in Nagaram village in Mamidikuduru mandal of the coastal district, about 550 km from Hyderabad.
State Finance Minister Y. Ramakrishnudu said 14 people were killed and many others were injured when the fire broke out early Friday.