The United States had won crucial backing from the European Union, with all 28 countries supporting the draft that would have condemned Hamas for firing rockets into Israel and demanded an end to the violence.
The resolution, backed strongly by Israel and the USA, needed a two-thirds majority to pass following an earlier vote in the assembly.
Sami Abu Zahri, a spokesman for Hamas, the militant group that has ruled the Gaza Strip since 2007, wrote on Twitter after the vote: "The failure of the American venture at the United Nations represents a slap to the USA administration and confirmation of the legitimacy of the resistance".
Their refusal to back the US resolution comes just weeks before the White House prepares to unveil a proposal to get Israelis and Palestinians back to the negotiating table.
Before the voting, US Permanent Representative to the UN Nikki Haley said that despite more than 500 General Assembly resolutions condemning Israel, not one condemning Hamas has ever been adopted.
Prior to the vote, US Ambassador to the UN Nikki Haley tweeted that "this afternoon, the UN will vote on a US resolution that asks a simple question: do countries support Hamas's terrorism, or don't they?"
Israeli Ambassador Danny Danon lamented after the vote that a decision to condemn Hamas had been "hijacked" by procedural votes and hailed the "broad support from the world" for condemning Hamas.
"She would like to go out with something", said a Security Council diplomat of the USA -drafted resolution.
United States envoy Nikki Haley had said adoption would right a "historic wrong" as the United Nations has not passed such a condemnation.
Resolutions adopted by the General Assembly are non-binding, however, they carry political weight and are seen as a barometer of world opinion.
Meghan Markle Made a Surprise Visit to King’s College London
Reports of a growing rift between the Duchess of Cambridge and the Duchess of Sussex have reached fever pitch in recent days. She reportedly jotted down notes on a pad during the discussion. "They don't really get on", a source told the Daily Mail .
The overwhelming support for the Irish resolution reflects global support for action "without delay" toward an end to the Israeli-Palestinian conflict and a two-state solution.
"This resolution was really just an attempt to weaponise the United Nations against the Palestinian people, against their legitimate rights", he told Al Jazeera.
Before the final vote, Haley reminded the chamber that last Friday the General Assembly voted six times in one day to condemn Israel.
In a symbolic stride, the US resolution did garner support by a majority of members, but failed because it required a supermajority.
Both the United States and European Union have classified Hamas as a terrorist group.
Shihab, in a post published on his official Twitter page, noted that Israel and the United States continue to spread lies by means of worldwide bodies and meetings.
It was the first proposed resolution condemning Hamas to be presented to the 193-nation assembly, which has been meeting since 1946.
The United States put forward the resolution as it prepares to unveil new peace proposals that the Palestinians have already rejected.
Following the vote, Israeli Prime Minister Benjamin Netanyahu applauded the "sweeping majority" of countries who voted for the draft condemnation. In recent months, the militant group has fired hundreds of rockets from Gaza into Israel.
"The resolution itself was just transparently Israeli talking points - it didn't mention the military occupation, the siege of Gaza, Israel's daily attacks against Palestinians in Gaza and the West Bank".
"The UN has a chance to condemn Hamas for the first time", Haley tweeted Thursday.