JERUSALEM — A bomb exploded on a bus in Bat Yam near Tel Aviv on Sunday minutes after the passengers were asked to get off, preventing casualties. The police said that initial evidence pointed to an attempted terrorist attack, presumably by Palestinian militants, the first of this kind in just over a year.

The driver of the bus, Michael Yoger, said that passengers had noticed a large bag that had been left on a seat. When nobody claimed it, one of the passengers looked inside and saw wires, Mr. Yoger told the Israeli news media, adding that he then told the passengers to leave the bus. About 10 minutes later, he said, there was an explosion.

A police officer on the bomb squad at the scene had his hearing affected by the blast, according to Micky Rosenfeld, a police spokesman. There were no other injuries. Mr. Rosenfeld said that based on the type of explosive device in the bag and the fact that it had been planted on a public bus, “It was clear it was a terrorist attack.”

President Shimon Peres of Israel thanked the bus driver in a telephone call, telling him, “The whole nation is saying prayers of thanks today; you saved so many lives with the speed and bravery of your actions.”