Security Minister Wiranto, 72, was stabbed in the abdomen as he was getting out of a car in the western Banten province, said national police spokesman Dedi Prasetyo. He was airlifted to an army hospital in Jakarta, where he is in stable condition, officials said.
A knife-wielding man had rushed Wiranto, who goes by one name, and the police chief in Pandeglang town, wounding both along with a third man. The attacker and his female companion were both arrested, police said.
While the motive for the attack was not immediately clear, Prasetyo told reporters they may have been inspired by the extremist ideology of ISIS.
"The perpetrators are alleged to have been exposed to Islamic State radicalism," Prasetyo said, without elaborating.
Investigators believe the attackers may have belonged to Jemaah Ansharuf Daulah (JAD), a radical Muslim militant group linked to ISIS, Prasetyo said. Officials suspect the group has followers in Banten, where authorities have said Muslim militants have a presence.
JAD has been blamed for past bomb attacks in Indonesia, including an attack on a church in 2018 that left 13 dead, the BBC reported.
The attack came just days before President Joko Widodo's inauguration for his second five-year term in office. Widodo, who appointed Wiranto to the top security post in 2016, visited him at the hospital.
Wiranto served as chief of the armed forces for two years beginning in 1998. He was blamed for the deaths of more than 1,000 people in East Timor when the province voted for independence in 1999, according to the BBC. Wiranto has denied the accusations.
He ran unsuccessfully for president and vice president in 2004 and 2009, respectively.
The Associated Press contributed to this report.