Australian journalist Nigel Brennan says he was chained up and pistol-whipped during a 15-month hostage ordeal in lawless Somalia.

Mr Brennan and his companion, Canadian journalist Amanda Lindhout, were captured by militants in Somalia in August last year. They were released and handed over to Somali officials yesterday and they are now in a hotel in the capital Mogadishu.

A kidnapper claims a ransom of around $1 million was paid, although it is unclear who may have put up the money.

"I'm just happy that I'm alive," said Mr Brennan, who revealed he had been pistol-whipped and locked in chains for the past 10 months after a failed escape attempt.

"Tonight we were ripped out of our rooms, stripped of everything, told to put on new clothes and then thrown in a car and then driven - we had no idea what was going on," Brennan told Reuters by phone from a hotel in Mogadishu.

"We were always kept by the same people. That was especially one of my concerns towards the end. They were talking about selling us to another group," he said.

"We've been through a pretty rough time, both of us. It's just to be free is amazing," the AFP news agency reported Mr Brennan as saying.

"It hasn't been the most pleasant experience of my life, but I'm just happy that I'm alive. I'm alive and looking forward to seeing my family and trying to pick up the threads of my life."

The pair are now trying to leave Somalia within the next 24 hours.

Mr Brennan's sister-in-law Kellie Brennan released a statement saying she had confirmed the release on behalf of the Brennan family.

Earlier Deputy Prime Minister Julia Gillard said the Government was working to get official confirmation of the pair's release.

The Australian and Canadian governments had both been working to secure the release of the pair.

Tortured

Ms Lindhout told Canadian TV that she was beaten and tortured during her captivity.

"It was an extremely, extremely difficult situation," she told CTV.

She said the kidnapping was criminal rather than political and that the ransom money paid by their families was going to be used by her captors to escape from Somalia.

"It was extremely oppressive, I was kept by myself at all times," she said.

"I had no-one to speak to, I was usually chucked in a room with a light and a window, I had nothing to write on, or with.

"There was very little food. Basically my day was sitting in a corner on the floor of the room, 24 hours a day for 15 months."

She says she was abused, probably to help motivate her family to get the ransom.

"There was times that I was beaten, that I was tortured, extremely, extremely difficult situations," she said.

"The money wasn't coming quickly enough for these men and they seemed to think that if they beat me enough then when I was able to speak to my mother - they would put me on the line with her every couple of months - I would be able to say the right thing to convince her to pay the ransom for me, which was $1 million.

"My family didn't have $1 million and it didn't matter what I said to them but they didn't really understand that, they thought 'she's Canadian, everyone in Canada is rich, she must have $1 million'. So they would beat me to try to prompt me to say these magic words that the money would produce itself. But of course it never did."

Ms Lindhout estimates they were taken to 11 different hiding places around Somalia but that most of their time was in the capital. She says throughout her ordeal she focused on the possibility of reuniting with her family.

"There were some pretty dark moments ... but I think human beings have an enormous capacity to adjust to trying circumstances and it was the idea of coming home, of a reunion with my family that kept me going," she said.

"In that darkness I would just try to escape in my mind to a sunny place, usually Vancouver, in my mind. I'd imagine running around ... and things like that. And that kept me going.

She says the phone calls to your mother were also helpful.

"It was always great to hear my mother's voice," she said.

"The conversations were very short and they were usually scripted on my part. My mother wasn't allowed to ask any questions and I also wasn't allowed to say what I wanted to say. They would come to me beforehand with a pen and paper and sort of guide me and tell me what I needed to say to her.

"It was always wonderful to hear mother's voice, that, the circumstances that we are talking were not very happy."

Seized leaving Mogadishu

Mr Brennan, whose family comes from Bundaberg in Queensland, and Ms Lindhout were kidnapped on August 23, 2008 as they were leaving Mogadishu.

They were en route to a refugee camp in a town just outside the capital where they planned to cover a story on internally displaced people in Somalia.

A Somali journalist, Abdifatah Mohammed Elmi, who was working as their interpreter, was also kidnapped. He was released in January.

A hotel employee told AFP that the two journalists were "very tired" following the end of their ordeal, one of the longest-running of many kidnappings in the lawless country.

In September 2008, a local tribal chief participated in negotiations to try to free the pair and said the kidnappers wanted $US2.5 million in ransom.

In January, he said the demand had been reduced to $US100,000.

According to Somali media, the two Westerners had escaped in February and found refuge at a mosque before being recaptured.

In May, the pair provided proof that they were still alive by calling media outlets.

"I have been sick for months," Ms Lindhout said at the time."Unless my government, the people of Canada, all my family and friends can get $1 million, I will die here. That is certain."

"The situation here is very dire and very serious. I've been a hostage for nine months, the conditions are very bad, I don't drink clean water, I am fed at most once a day," she said.

"I'm being kept... in a dark windowless room, completely alone."

Somalian MP Ahmed Diiriye said Mr Brennan and Ms Lindhout were brought on Wednesday from southern Mogadishu by militiamen and were handed over to the people who had negotiated the release.

- ABC/wires