JAKARTA (Reuters) - Indonesia's parliament speaker Setya Novanto has been taken into custody by the country's anti-corruption agency after being arrested over his alleged role in causing state losses of $170 million linked to a national electronic identity card scheme.

Novanto, wearing an orange vest worn by detainees of the Corruption Eradication Commission (KPK), was transferred from a hospital on Sunday night into a KPK detention facility at its headquarters in Jakarta.

He is one of the most senior politicians in Indonesia to be detained by the independent KPK.

The parliament speaker was arrested on Friday night but KPK said it delayed enforcing his detention while he received treatment for injuries sustained in a car crash the day before.

Laode Muhammad Syarif, deputy head of the KPK, said in a video posted on the agency's official Periscope page that a doctor's statement showed Novanto no longer needed to be treated in hospital "therefore according to standards and procedure the delay of the arrest is no longer needed."

In comments made to reporters on Sunday night, Novanto said he was still suffering from vertigo after the crash that he said had caused injuries to his leg, arm and head.

"I did not expect this (to happen) tonight. I thought I would be given time for recovery, but I obey the law," Novanto was quoted by Kumparan.com as saying.

Officers from KPK tried to arrest Novanto, the chairman of Golkar, Indonesia's second-largest party and partner in the ruling coalition, at his house in Jakarta late on Wednesday.

But the investigators, watched by television cameras, failed to find him, sparking speculation that he had gone into hiding.

Later, Novanto was involved in a car accident and his lawyer, Fredrich Yunadi, said a journalist was driving the vehicle and interviewing his client at the time of the accident.

Novanto has denied wrongdoing but has repeatedly missed summonses from the KPK for questioning in recent months, saying he was ill and needed to undergo heart surgery.

The KPK is investigating state losses amounting to about $170 million linked to a national electronic identity card scheme after allegations that sums ranging from $5,000 to $5.5 million - generated by marking up procurement costs - were divided up among politicians in parliament.

Novanto was named a suspect on Nov. 10 again after he had used a controversial legal maneuver, a pre-trial motion, to get earlier charges dropped last month.

Novanto's lawyer has said a request for another pre-trial motion had been filed on behalf of his client.

The house speaker gained a measure of international fame in September 2015 when then U.S. presidential candidate Donald Trump hailed the Indonesian politician as a "great man" during a news conference.

"Do they like me in Indonesia?" Trump asked after introducing Novanto to reporters at Trump Tower.

"Yes, highly," Novanto replied.

Indonesians have been gripped by the drama around the case with newspapers splashing the story across their front page and circulating memes mocking Novanto.

Despite repeated efforts by politicians and police to undermine it, the KPK has remained one of Southeast Asia's most effective and independent agencies. It investigated 91 people last year, a record in its 15-year history, data provided by the agency showed.