RAMALLAH, West Bank (Reuters) - Hamas's popularity among Palestinians has risen sharply since a three-week Israeli war in January devastated the Islamist-ruled Gaza Strip, an opinion poll released Monday showed.

If an election were held today, Hamas leader Ismail Haniyeh would beat Mahmoud Abbas, the Western-backed Palestinian president and leader of Fatah who advocates a peace deal with Israel.

The face-to-face poll of 1,270 people by the Palestinian Center for Policy and Survey Research was conducted on March 5-7 in the West Bank and Gaza Strip, as the factions tried to reach agreement on a unity government with Egyptian mediation.

Hamas, which Western powers shun as a terrorist organization, won a Palestinian parliamentary election in 2006 and seized control of the Gaza Strip the next year after fighting with Fatah.

Israel responded by tightening its blockade of the coastal enclave, increasing hardships for its 1.5 million residents.

The January war, which Israel launched with the stated aim of stopping cross-border rocket fire by militants, killed some 1,300 Palestinians, destroyed 5,000 homes and left much of Gaza's governmental and economic infrastructure in ruins.

Despite the visible increase in the popularity of Hamas and Haniyeh, the pollsters reported, the overwhelming majority, 71 percent, believes Palestinians are worse off than they were before the war.

The survey said Haniyeh would garner 47 percent support, beating Abbas with 45 percent, if a presidential election was held today. Three months ago, Abbas received 48 percent and Haniyeh 38 percent.

But if the competition were between Haniyeh and Marwan Barghouthi, the popular Fatah leader currently imprisoned by Israel, Barghouthi would win by 61 percent to 34 percent, the survey showed.

Fatah, however, remains the most popular faction with 40 percent of overall support, compared to 42 percent last December, it said. The popularity of Hamas in the same period increased from 28 percent to 33 percent in the latest poll.

The most important priority for Palestinians today, in the eyes of 46 percent of the sample, should be the unification of the West Bank and the Gaza Strip.

Nearly two-thirds believe a Hamas victory in presidential and legislative elections would lead to the tightening of the Israeli blockade of the Gaza Strip, whereas nearly as many believe a Fatah victory would mean the end of the blockade.

Respondents in Gaza in particular believe a Hamas victory would perpetuate the blockade and the rift in Palestinian ranks.

(Reporting by Ali Sawafta; Writing by Douglas Hamilton in Jerusalem; Editing by Ralph Boulton)