India has executed the lone survivor of a militant squad that killed 166 people in a rampage through the financial capital Mumbai in 2008.

Mohammad Ajmal Kasab was hanged just days before the fourth anniversary of the attack.

The Pakistan national was the enduring image of the assault, which traumatised India.

Pictures of the young gunman wearing a black T-shirt and toting an AK-47 rifle as he strode through Mumbai's train station were published around the world.

The hanging took place early today amid great secrecy, underscoring the political sensitivity of the massacre, which still casts a pall over relations between nuclear-armed rivals Pakistan and India.

He was buried inside the prison where he was hanged, officials said.

India said it would hand over the body to Pakistan if a request was made.

"All the police officers and personnel who lost their life in the battle against the terrorists have today been served justice," Home Minister Sushil Kumar Shinde said shortly after Kasab was hanged in a jail in Pune, southeast of Mumbai.

It was the first time a capital sentence had been carried out in India since 2004.

In August, India's Supreme Court upheld Kasab's 2010 death sentence over the attacks on a string of targets.

Nearly 60 people were gunned down in the train station alone.

President Pranab Mukherjee rejected his plea for clemency on 5 November, although this was not made public until last night.

Ten militants arrived on the Mumbai shoreline in a dinghy on 26 November 2008, before splitting into four groups and embarking on a killing spree.

They held off elite commandos for up to 60 hours in two luxury hotels and a Jewish centre in the city.

India accuses Pakistan-based Lashkar-e-Taiba (LeT) of organising the attacks and says Islamabad is failing to act against those behind the raids. Pakistan denies involvement and says it is prosecuting seven suspected militants for their role.