MANILA, Philippines-The Supreme Court on Tuesday nullified the P240-million deal between the Commission on Elections and Smartmatic-Total Information Management for the diagnosis and repair services of its 82,000 poll machines.

According to Associate Justice Estela M. Perlas-Bernabe, who penned the decision and was carried unanimously, the deal was unconstitutional.

The high court en banc said Comelec’s “refurbishment deal” with Smartmatic, which was issued with a temporary restraining order earlier, was contrary to the conditions under the Government Procurement Reform Act.

The Integrated Bar of the Philippines and election watchdog Automated Election System Watch had filed separate petitions to the court against the contract, also calling it a “midnight deal” after it was signed by former Comelec chairman Sixto Brillantes only three days before he retired from office on January 30, 2015.

Comelec however reasoned out that lack of time prevented them to hold public bidding on said services.

“It is clear that the Comelec committed grave abuse of discretion and, thus, its Resolution No. 9922 and the Extended Warranty Program (Part 1) should be stricken down and, necessarily, all amounts paid to Smartmatic-TIM pursuant to said contract, if any, being public funds should be returned to the government,” the high court said.

Despite the decision, the Comelec is confident that they still have enough time to prepare for the May 2016 elections.