MUMBAI, India  At midmorning on Friday, as Indian troops continued to comb through the devastated Oberoi hotel, an unexpected guest appeared on the sidewalk: Narendra Modi, a Hindu nationalist from the opposition Bharatiya Janata Party and arguably India’s most incendiary politician.

Speaking before a row of television cameras, he said the central government had failed to tackle a growing terrorism threat and he found fault with a speech by India’s prime minister a day earlier. “The country expected a lot from Prime Minister Manmohan Singh,” he said, “but his address to the nation was disappointing.”

The appearance of Mr. Modi  who has been barred from entering the United States for violations of religious freedom  signaled how the two-day siege of Mumbai had instantly turned into political ammunition for coming national elections. After a string of attacks across Indian cities earlier this year, Mr. Modi’s party, also known as the B.J.P., pledged to make national security its main campaign issue. This week’s audacious attacks on the country’s commercial capital, and their timing, gave the party an additional boost.

Five state elections are under way, with the city-state of Delhi going to the polls on Saturday. National balloting is expected to be held next spring.