JERUSALEM — A militant hard-liner who served more than 20 years in Israeli prisons has been chosen as the new leader of Hamas in Gaza, an official for the group confirmed on Monday. The move could further isolate the impoverished Palestinian coastal enclave and portend a more aggressive stance against Israel.

The new leader, Yehya Sinwar, in his mid 50s, is said to have emerged after two weeks of secret elections within Hamas, the Islamist group that has controlled the Gaza Strip for the past decade. He carries a reputation as a harsh enforcer of loyalty within the group, and as an unstinting enemy of Israel.

The leadership change immediately raised questions about whether another war between Israel and Hamas is now more likely; though no hostilities seem imminent, both sides are well prepared. Even before the Hamas leadership change, some hard-line Israeli officials had said the question of renewed fighting in Gaza was not if but when.

Another issue is reconciliation with the Western-backed Palestinian Authority in the West Bank. Some experts said it seemed less likely under Mr. Sinwar, who as a political leader had served as the bridge to Hamas’s military wing. But the Hamas official who confirmed the leadership change also said that Mr. Sinwar had been active in negotiations to reunite Gaza and the West Bank.