A Pakistani Taliban faction has claimed responsibility for the Karachi attack on Tuesday killing two military officers, a spokesman for the Islamist group said.

Ehsan Ullah Ehsan, the spokesman for the group, Jamaat-ul-Ahrar said late on Tuesday that both the officers were on the "target list" of the Pakistani Taliban faction.

The police said the gunmen attacked the vehicle while they were patrolling a crowded area of the city. The vehicle was carrying officers from an intelligence agency.

Tuesday's attack was the latest in the busy port city of 20 million people. The paramilitary forces have been cracking down on Islamist militants and criminal gangs in Karachi for almost three years, boosting the security in the city.