PESHAWAR, Pakistan — A candidate from a political party opposed to the Taliban was killed in a suicide bombing late Tuesday as he campaigned in northwestern Pakistan, just weeks before the country goes to the polls.

At least 12 people were killed and dozens were wounded, several of them critically, police and hospital officials said. The death toll was expected to rise, officials said.

There was no immediate claim of responsibility, but immediate suspicion fell on the Pakistani Taliban, which has frequently attacked secularist politicians.

The attack raised concerns about the safety of candidates running in the July 25 general elections, and immediately cast a pall across Pakistan. It was the first such attack of this year’s campaign.