Pakistan protested to Afghanistan Thursday at what it called the killing of 23 Pakistani soldiers on Afghan soil, the foreign ministry said.