Martin Feldman, the US district judge in New Orleans, ruled on Tuesday that the moratorium was arbitrarily imposed and that the interior department had failed to provide adequate reasoning for the moratorium.
"An invalid agency decision to suspend drilling of wells in depths of over 152 metres simply cannot justify the immeasurable effect on the plaintiffs, the local economy, the Gulf region, and the critical present-day aspect of the availability of domestic energy in this country," Feldman wrote in a statement.
The moratorium was imposed after the April 20 explosion on the Deepwater Horizon drilling rig that killed 11 workers and blew out the well that has spewed millions of litres of oil into the Gulf of Mexico.
The interior department said it imposed the moratorium so it could study the risks of deepwater drilling, but the case filed by Hornbeck Offshore Services of Covington, Louisiana, claimed there was no proof other operations posed a threat.
The moratorium was declared on May 6 and originally was to last only until the end of the month. But Barack Obama, the US president, announced on May 27 that he was extending it for six months.
The court's ruling was a victory for offshore energy producers such as BP, Chevron and Royal Dutch Shell, which had been hamstrung by the ban.
Loss of business
Bobby Jindal, the governor of Louisiana, echoed corporate leaders' opposition to the moratorium, saying it would result in drilling rigs leaving the Gulf of Mexico for lucrative business in foreign waters.
They say the loss of business will cost the area thousands of lucrative jobs, most paying more than $50,000 a year. The state's other major economic sector, tourism, is a largely low-wage industry.
The government had challenged contentions that the moratorium would lead to long-term economic harm.
Although 33 deepwater drilling sites were affected by the order, there were still 3,600 oil and natural gas production platforms in the Gulf of Mexico, the government said.
Expanding offshore drilling was among Obama's proposals to revamp US energy policy, in the hopes it would generate support from opposition Republicans for aspects of his plans to fight climate change.
But the US president shelved the expansion plan after the BP crisis erupted.