ISLAMABAD—Pakistani investigators probing last week's attack by the Taliban on a naval base in Karachi have detained a former navy commando and two other people, in further signs of concern about the infiltration of radical Islamist groups into the country's armed forces.

Pakistani investigators Friday picked up Kamran Ahmed Malik, 36 years old, along with his brother, Zaib Ahmed, from a middle-class neighborhood of Lahore, the capital of Punjab province, according to security officials in the city.

Another...