Third-time candidate Prabowo, a former special forces commander, has held a strong lead in opinion polls for the Feb. 14 election, but his military modernisation drive drew flak in a second televised face-off focused on security and geopolitics.

Former Jakarta governor Anies Baswedan denounced Prabowo's plans to procure used military equipment, including a fleet of Mirage 2000-5 fighter jets from Qatar, and accused his defence ministry of failing to protect itself from hackers who last year threatened to leak confidential information.

"Ironically, defence ministry was hacked," Anies said. "The 700 trillion rupiah ($45.13 billion) budget cannot be used to contain it. Instead, it is used to buy second-hand military equipment."

Dressed for the debate in an air force-style bomber jacket, the ruling party's candidate Ganjar Pranowo said the jets deal, which the government has delayed over budget issues, was "reckless planning".

Southeast Asia's biggest economy has for the past decade lagged regional peers in defence spending as a share of gross domestic product.

Prabowo justified the strategy to buy used hardware as essential in modernising the armed forces, adding the 15-year-old jets had a 25 to 30 year lifespan.

"The narrative about using used equipment, I think, is misleading. The important thing is flying hours," he said.

"In reality we need equipment to cover the current gap," he said, adding new jets take longer to arrive.

Most polls have Anies neck-and-neck with Ganjar, though far adrift of leading candidate Prabowo, who has picked as running mate Gibran Rakabuming Raka, the son of the popular two-term President Joko Widodo.

Anies said that choice showed Prabowo had "compromised ethics standards", after Gibran was only beneficiary of an acrimonious court ruling that changed eligibility rules just days from election registration.

The candidates were also asked how they would address long-running disputes over the South China Sea.

Prabowo said Indonesia needed better technology to defend its territory, while Anies said it should become a dominant leader in the Association of Southeast Asian Nations (ASEAN), to ensure a common position.

Ganjar proposed a review of the bloc's much-criticised decision making approach and said a 2002 agreement between China and ASEAN countries to avoid maritime disputes had failed.

"We can take the initiative through temporary agreements to avoid higher risks," Ganjar said, without elaborating.

(Reporting by Ananda Teresia and Bernadette Christina; Editing by Martin Petty)

By Ananda Teresia and Bernadette Christina