An Egyptian court on Saturday overturned a February decision by another tribunal branding Hamas a "terrorist" group, a court official said, according to AFP.
The official told the news agency that the earlier ruling was thrown out because the court that issued it was not "competent" to make such verdicts.
The February ruling came after a lawyer petitioned the court to classify Hamas as a terrorist organization, accusing it of using underground tunnels to smuggle weapons into Egypt.
But in March the government appealed against the ruling, which took ties between Hamas and Egyptian authorities to a new low.
The Islamist movement had strongly condemned the February verdict, which came a month after Hamas’s “military wing”, the Izz ad-Din al-Qassam Brigades, was designated as a terrorist organization by Egypt at the beginning of February.
Egypt is a traditional broker between Israel and Hamas.
On Saturday, the group issued a brief statement saying that the new ruling corrects "a wrong decision".
"Hamas welcomes the Egyptian court's decision," it added, according to AFP.
Hamas has been the subject of a crackdown by Egyptian authorities ever since the military ousted former Islamist President Mohammed Morsi.
Most recently, Egypt accused Hamas of providing the weapons used by terrorists for two lethal attacks in El-Arish in October, in which dozens of soldiers were killed.
After the October attack, the Egyptian military stepped up a campaign to build a buffer zone along the border. The buffer zone was initially planned to be 500 meters wide, but Egypt later decided to expand it by another 500 meters.