Gunmen in Pakistan killed at least 23 people after stopping vehicles on a highway and checking their identities, according to reports.