The Federal Court had cleared Mr Habib to sue the federal government over his alleged torture while held in Pakistan, Egypt, Afghanistan and Guantanamo Bay.
Mr Habib brought the case alleging that Australian agents were complicit in his treatment.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Ms Gillard on Saturday confirmed an out-of-court settlement had been reached, the details of which were confidential.
"As reported in papers today, an out-of-court settlement has been reached," she told reporters in the flood-hit Queensland town of St George on Saturday.
"The settlement is confidential. Clearly, this is a matter that has been a long time in the making.
"And in the interests of the Commonwealth it wasn't in our interests to have a long and protracted litigation.
"And so the matter has been settled."
She refused to disclose if Mr Habib had been offered an apology, adding: "It was in the interests of taxpayers to bring this matter to an end".

