Brazil's outgoing president ignited a vicious diplomatic row on his last day in office today after refusing to extradite a former leftwing terrorist to Italy.

A day before stepping down, Luiz Inácio Lula da Silva finally signed off on the decision not to extradite Cesare Battisti, an Italian thriller writer who was arrested in Rio de Janeiro in March 2007 and is wanted in Italy for four murders.

Lula's move triggered a rare crisis in relations between two countries with strong historical and commercial links. Italy announced it was temporarily withdrawing its ambassador and criticism rained in from both sides of the political spectrum.

Italy's prime minister, Silvio Berlusconi, expressed "profound bitterness and regret" and vowed to "fight on" against a ruling that was "contrary to the most elementary sense of justice".

An earlier statement from Berlusconi's office said: "President Lula ought to explain the choice not only to the government, but to all Italians and in particular to the family of the victims and a man reduced to [life in] a wheelchair."

Brazilian politicians immediately hit back. A foreign ministry statement expressed the government's "profound discomfort" at Italy's "impertinent" comments about Brazil's departing leader. The foreign minister, Celso Amorim, described Italy's response as "very strange".

"Italy's retaliation against Brazil is a shot in its own foot," one Brazilian government source told the O Globo newspaper.

Battisti, 56, was a member of a terrorist group called the Armed Proletarians for Communism, one of many violent ultra-left groups whose bombings, kidnappings and killings rocked Italy in the 1970s and 80s. He was found guilty in Italy of three murders and complicity in a fourth which left the son of the victim paralysed.

Battisti, who has lived in Brazil since 2004 and is the author of 12 critically acclaimed novels, has vehemently protested his innocence, saying his conviction was based on false testimony.

Today's decision is the latest twist in a story going back almost 30 years. In 1981, Battisti, jailed on lesser charges, escaped from prison and fled, first to France, then to Mexico. In 1990 he returned to France where he built his career as a writer.

Three years later he was convicted in his absence of the murders and in 2004, fearing the French courts were about to hand him back, Battisti disappeared again and was arrested three years later in Brazil. The Brazilian supreme court ruled last year he should be extradited. The court left the final decision to Lula, who, according to a government statement, received an opinion from the attorney general to the effect that he should not proceed.

Battisti's extradition has been taken up as a cause by Berlusconi's rightwing government, but it is supported by some in the opposition. Lula also came under fire at home. Álvaro Dias, an opposition senator from the Brazilian Social Democratic party, said the decision had put "at risk diplomatic relations with a friendly country which has companies, agreements and even a colony in Brazil".

The party's president, Sergio Guerra, said Lula's decision was an example of "megalomania". "Lula thinks he is above good or evil, that the only valid viewpoint is his own and that he invented Brazil."

At least 13% of the Brazilian population is of Italian descent. Brazil is also an important market for the Italian car company Fiat whose CEO joined Lula on Wednesday to lay the first stone at a R$3bn (£1.2bn) plant near Recife.

Kennedy Alencar, a commentator on Brazil's Folha de São Paulo newspaper, said that while Lula was not particularly sympathetic to Battisti, he had been irritated by Italian demands."Italy put a knife to Brazil's neck and with the lights going out on his government Lula decided to please the leftwing Workers party audience," he said. The move had spared his successor, Dilma Rousseff, any political fallout early in her government.