Media playback is unsupported on your device Media caption The BBC's Yogita Limaye said a rescue operation was under way

At least 18 sailors are feared to be trapped on board an Indian submarine that caught fire after an explosion in a Mumbai dockyard, officials say.

The blast occurred shortly after midnight and it took fire-fighters several hours to douse the blaze.

Officials say the diesel-powered vessel was badly damaged and remains partly submerged at its berth.

Many sailors managed to jump to safety. Rescue teams are on scene and some of the injured were taken to hospital.

It is unclear exactly what caused the explosion on the INS Sindhurakshak but dramatic images on Indian television appear to show a large fireball illuminating the sky. Smoke from the blaze could be seen in many parts of the city.

A naval inquiry has been set up to look into the causes of the incident, but officials told the BBC they suspect it to be the result of an on-board error and not an act involving any outside agency.

Russian-built vessel

"There are some people who are trapped on board, we are in the process of trying to rescue them, we suspect it to be in the range of 18," Navy spokesman PVS Satish was quoted by the Reuters news agency as saying.

"We will not give up until we get to them," he added.

INS Sindhurakshak timeline 1997: INS Sindhurakshak procured by Indian navy, one of the 10 vessels in the Kilo-class submarines bought from Russia between 1986-2000

INS Sindhurakshak procured by Indian navy, one of the 10 vessels in the Kilo-class submarines bought from Russia between 1986-2000 February 2010: A fire that broke out in its battery compartment kills one sailor

A fire that broke out in its battery compartment kills one sailor August 2010: Submarine sent for re-fit to equip it with cruise missile systems

Submarine sent for re-fit to equip it with cruise missile systems June 2012: Refit completed with refurbished hull and 10 years added to its 25-year service life

Refit completed with refurbished hull and 10 years added to its 25-year service life October 20102: Sea trials begin for submarine

Sea trials begin for submarine 14 August 2013: Submarine hit by explosion and fire with sailors feared trapped inside

Officials also told the AFP news agency that divers had been deployed when the flames were put out and that they were hunting for the men on board.

The INS Sindhurakshak is said to be one of the 10 Kilo-class submarines bought from Russia between 1986 and 2000. It is equipped with Russian Club-S cruise missile system.

The vessel, which is powered by diesel and electricity, returned from Russia last year after undergoing an upgrade and sea trials began last October, reports said.

In February 2010, a sailor on board the submarine was killed by a fire that broke out in the battery compartment while the submarine was docked at the Vishakhapatnam naval base - it was later that year that it was sent to Russia for the refit.

This explosion comes just days after India's navy launched its first home-built aircraft carrier, hailed by officials as a "crowning glory".

Last year, India bought a Russian Nerpa nuclear submarine for its navy on a 10-year lease from Russia at cost of nearly $1bn (£645m), making it part of a select group of nations to operate nuclear-powered submarines.

India and Russia are long-time allies and Russia supplies about 70% of India's military hardware.