By Steve Kingstone
BBC correspondent in Sao Paulo
The Brazilian government has reversed its decision to expel a US journalist who alleged that President Luiz Inacio Lula da Silva had a drink problem.
Lula - here enjoying a glass of water - was angry about the claims
Larry Rohter made the claim in last Sunday's New York Times.
On Tuesday, the authorities in Brasilia announced that his work visa was to be cancelled.
But Justice Minister Marcio Thomaz Bastos said the decision was rescinded on receipt of a letter from Mr Rohter which he described as an apology.
This dispute appears to have been settled. But even now, the New York Times and the Brazilian government cannot agree on how it ended.
On Friday evening Mr Bastos announced he was cancelling the order to expel Mr Rohter.
He said the letter from Mr Rohter's legal team offered a retraction of the newspaper's allegation.
The article and the government's initial response both proved damaging to Brazil's international standing
Mr Bastos said the journalist denied intending to offend the president.
In a statement, the New York Times welcomed the move, calling Brazil an important country.
But it added that Mr Rohter's letter did not contain an apology or a retraction. The statement insisted the original story was fair and accurate.
Hardly handshakes all round, so is this really the end? Many here will hope so.
The article and the government's initial response both proved damaging to Brazil's international standing and for its part, the New York Times has destroyed its image in this country.
The sorry affair should finally draw to a close on Monday, when the government will formally restore Mr Rohter's status as an approved journalist, provided there are no more twists between now and then.