Did Hamas take power via a coup or free elections?

I’m not looking for a debate here; hoping this turns out to be a simple factual Q and A.

When I read pro-Israeli sources, like: http://www.debka.com/headline.php?hid=5856 they say that Hamas took power via a coup. But others write that Hamas won an election.

I honestly have no opinion on this one, that’s why I’m asking

Hamas won a majority in parliament, and thus should have been able to form a governmen’t. Abbas, a Fatah member, used various shenanigans, backed by the U.S. and Israel, to keep Hamas from forming a government. He eventually declared a state of emergency, and dismantled the cabinet formed by Hamas, and installed an “independent” one. This precipitated a bloody coup by Hamas, resulting in the situation we have today.

In short, Hamas legitimately won power, and then staged a coup to realize that power.

By election and ( in a way ) by coup.

The Palestinian electoral system is a little complicated, combining both a proportional allocation with seperate geographic seats. Generally what happened is that Hamas won 43-46% ( I’ve seen different numbers ) of the votes, but 56% of the seats, while Fatah won ~40% of the vote and only about 34% of the seats ( the rest to seperate, mostly secular parties ), due to Fatah and other secular parties splitting their votes on multiple candidates for any given seat, while Hamas carefully ran just one candidate per geographic seat. In addition Hamas seems to have anecdotally benefited a great deal from people fed up with Fatah corruption and nepotism, something the moralistic Hamas seemed less guilty of.

However within the confines of the above Hamas utterly dominated the vote in the poorer, more crowded, more radicalized Gaza strip. It was a distinct geographic stronghold for them. What then happened in the wake of the election is that entrenched local Fatah and Hamas in Gaza began to squabble over resources and control, particularly over things like police stations ( actually said squabbles pre-dated the elections, but intensified after them ). This finally degenerated into violence and led to Hamas forcefully usurping control in Gaza, excluding Fatah from any real government functions. Fatah has somewhat retaliated by excluding Hamas from the central government ( such as it is, which isn’t much ) in the West Bank, where they are much stronger. De facto you have two different regional Palestinian governments, each claiming to be the lawful one.

Wiki link: Fatah–Hamas conflict - Wikipedia

Thanks for responses. Sounds like both statements are true.