Police say gunmen have shot and killed four police officers who were guarding a railway track in southwestern Pakistan after local authorities were alerted about plots to plant bombs targeting trains along the route.

Senior police officer Shaukat Ali says Saturday's attack took place on the outskirts of Quetta, the capital of the troubled Baluchistan province.

No one claimed responsibility for the attack, but Baluchistan is believed to be a refuge for Taliban and Pakistani militants. It has also witnessed a decades-long insurgency by nationalists who demand greater autonomy and a larger share of the province's resources such as natural gas and oil.

A bomb planted outside a seminary in Quetta killed 14 people on Thursday.