A former Nigerian presidential adviser accused of diverting $2.2 billion meant to buy weapons to fight Boko Haram is challenging the government's right to put him on trial.

Retired Col. Sambo Dasuki, who was national security adviser to ex-President Goodluck Jonathan, asked the High Court Friday to discharge all charges against him because the government flouted court orders to release him on bail.

He said the charges cannot be lawfully prosecuted by a government in brazen disobedience of the court's order.

Dasuki has been detained for nearly two months. President Muhammadu Buhari has blamed him for deaths and abductions of civilians because soldiers were not adequately equipped to fight the Islamic extremists. He said his government wouldn't allow Dasuki to jump bail.

The case has been adjourned until Feb. 4.