Mehmet Ali Agca, the Turk who attempted to kill pope John Paul II in 1981, was freed after almost 25 years in Turkish and Italian prisons to reactions of both protest and joy.

Clad in jeans and a blue sweater, Agca, 48, emerged from the main building of Kartal jail on the Asian shore of Istanbul, surrounded by about a dozen armed soldiers.

He climbed into a white car just inside the main gates of the prison and was driven out of the facility as far-right sympathizers pelted the vehicle with red and yellow flowers, an AFP correspondent reported.

Agca was taken straight to the Pendik military recruitment office because, to the Turkish authorities, he is just another draft dodger who still owes his country the compulsory military service all Turkish males over 18 must perform.

His lawyer has said that he would ask for an arrangement under which Agca will pay a hefty sum in lieu of military service, or ask to be exempted on health grounds.

Agca emerged from the building in about half an hour, amid ovations from a group of far-right activists, brandishing a large Turkish flag.

"We came here to show our support for him and we are very happy," one of them, Ozcan Toramanoglu, said. "Agca served more than enough in jail."

He climbed on a black luxury car this time, waving to the crowd.

He was taken to the distant Istanbul suburb of Tuzla, home to one of Turkey's major infantry training camps, to undergo a check-up at a medical facility there, an AFP photographer following Agca reported.

Agca served 19 years in Italian prisons for his most notorious act -- the May 13, 1981, attack on John Paul II in St. Peter's Square, whose motives remain to this day shrouded in mystery.

He was pardoned by the Italian authorities and extradited to Turkey in June 2000 and was serving time for two bank robberies committed in the 1970s and for the 1979 murder of Abdi Ipekci, a popular liberal newspaper editor and columnist with the daily Milliyet.

He would have served 36 years, but he was released under reductions that accompanied amnesty laws and European Union-inspired reforms to the Turkish penal code that cut prison terms for the crimes he was found guilty of.

Agca was a 23-year-old militant of the notorious far-right Grey Wolves organization, on the run from Turkish police, when he opened fire on the pope as the pontiff drove to an audience in an open vehicle.

John Paul II was seriously wounded in the abdomen and Agca spent the next 19 years in Italian prisons.

The pope later met him in prison and forgave him, but why Agca acted as he did remains a mystery.

He has claimed it was part of a divine plan, and charges that the Soviet Union and then-communist Bulgaria were behind the assassination attempt were never proven.

Agca himself has given often contradictory statements, frequently changing his story and forcing investigators to open dozens of inquiries.

The late pope wrote in his last book, "Memory and Identity", that he was convinced the assassination attempt was planned and commissioned and that Agca was a mere puppet.

Many see Agca as deranged -- he has often claimed to be a "second Messiah" -- while others believe he is a sly operator only playing the fool.

In his latest pronouncement, published Wednesday in the Turkish daily Vatan, he said he was "the first universal spokesman of God" and to have declined an offer from the Vatican "to climb to the head of the Holy See" provided he converted to Roman Catholicism.

His release has sparked protests by the lawyer of the Ipekci family, who argues that Agca's release is based on a miscalculation of the reductions foreseen in Turkish law.

Former justice minister Hikmet Sami Turk, who oversaw Agca's extradition to Turkey in 2000, has said he should not have been released until 2012.

"A day of shame," headlined the liberal Milliyet, the newspaper of his first victim, Abdi Ipekci, while the mass circulation Hurriyet blared: "The most notorious murderer is free."