BATS Global Markets cancelled its eagerly awaited stock market listing on Friday, and has blamed a serious failure in its IPO software for the problem.

The glitch at the electronic stock exchange - which prevented it from selling its shares on its own stock exchange, resulting in the cancellation of its IPO - also affected the listing of Apple shares, which briefly plummeted by nearly 10 percent.

The problems with the IPO software lasted for several hours overall. While the initial auction of BATS shares worked, the exchange was not then able to allow continuous trading.

Joe Ratterman, chief executive at BATS, insisted in a statement to the markets that the stock exchange had put the system through "rigorous testing", including several months of internal tests followed by weeks of running it with market participants.

A "software bug related to facilitating IPO auctions" was the cause of the problem, he said. "This was the first corporate IPO on the BATS Exchange. While we had spent months testing our system, an unforeseen bug appeared during the BATS IPO auction that caused the system failure."

"Unfortunately, sometimes technology implementations are prone to failures and unexpected outcomes, even after going through rigorous testing."

Describing the problem as a "serious technical failure", Ratterman said the outage was "a devastating moment for our company, our associates, our members, our investors and our underwriters".

"This failure was particularly painful since we've prided ourselves on being one of the most stable and resilient stock exchanges in the industry," he added. "Over the past three years, the BATS Exchange has a performance record of being 'up' more than 99.9% of the time."