Canadian journalist Maziar Bahari has been released on bail after more than three months inside an Iranian prison, according to official state media.

The Islamic Republic News Agency said Bahari was freed from Tehran's Evin Prison after posting bail of 3 billion rials, or about $300,000.

The 42-year-old Newsweek reporter was arrested on June 21. He was among more than 100 people accused of being part of a plot to spark a revolution and topple Iran's clerical leaders.

The arrests came during massive public demonstrations against the Iranian presidential election. Activists said the results were rigged and Iranian President Mahmoud Ahmadinejad should not have won.

Bahari's employer also reported that he has been released. Newsweek published a statement late on Saturday afternoon saying that Bahari "is home with his family today."

"We would like to thank all of those who supported Maziar through this long and uncertain period," the statement continues.

According to the magazine, no reasons were given for his release but it may have been based on humanitarian considerations. Bahari's wife is eight-and-a-half-months pregnant and has been experiencing serious health complications.

She was rushed to hospital last Monday.

Foreign Affairs Minister Lawrence Cannon released a statement on Saturday evening that confirmed Bahari had been freed.

"It is with great relief that we welcome the release of Maziar Bahari from prison in Iran," the statement reads. "The government of Canada shares in the joy of Mr. Bahari's family, friends, colleagues, and countrymen and hope that he will soon be able to join his wife for the birth of their first child."