CAIRO - On the eve of the uprising that swept Hosni Mubarak from power, the Muslim Brotherhood braced itself for a wave of mass detentions, convinced the president was planning to hand power to his son and would order a crackdown on opposition.
It is a testament to how much has changed since then that the Islamist group has emerged as one of the strongest challengers for the deposed Mubarak's job in a May 23-24 election.
"The group was preparing for a knock-out blow," said Essam el-Erian, a Brotherhood leader who was behind bars when the uprising erupted but today receives journalists at an opulent office in parliament, where his group controls close to half the seats. "It wasn't decorated like this for us," he joked.
The 15 months since Mubarak was ousted have been a historic chapter in the story of a movement that has gone from being an outlawed group to a political party courted by foreign states and vying for power.
Fears that the military rulers who replaced Mubarak might once again crack down on the group have diminished. The Brotherhood believes too much has changed in Egypt to allow any repeat of 1954, when Gamal Abdel Nasser drove it underground.
But while the era of dawn raids appears to be over for the Brotherhood, Egypt's post-uprising politics have brought new challenges: new Islamist rivals, a more critical public, a degree of internal dissent and the revival of an old debate about the rights and wrongs of its mix of religion and politics.
Its main Islamist rival for the presidency is Abdel Moneim Abol Fotouh, a former member of the movement whose bid is testing the loyalty of some Brotherhood members and has drawn Islamist support away from Mohamed Mursi, the group's candidate.
The Brotherhood is hoping for the best - victory in the presidential election, but also contemplating a different outcome - defeat that could lead to being denied any meaningful say over government and going into opposition.
The Brotherhood fears the powerful military establishment could yet thwart its efforts to secure a slice of government.
"The Brotherhood has certainly been more assertive since its victory in the elections. This has come as the movement has become more sure of itself and its support base," said Alison Pargeter, an expert on the Brotherhood.
"However, the Brotherhood is facing many challenges, not least of which is how it will manage the internal contradictions that have hampered it more or less since its inception," said Pargeter, author of a book on the movement.
A future in the opposition?
At the Brotherhood's headquarters, one of its most influential voices described a bittersweet period for a movement elected to parliament but blocked by the generals from having any say in government.
Mahmoud Ezzat, the Brotherhood's deputy leader, said that was a prime reason for its entry into the presidential race - a controversial decision that was taken as recently as March and reversed a previous pledge not to contest the position.
"This was not just a right, but an obligation," Ezzat told Reuters. Ezzat envisages the presidential election as the start of an eight-year struggle with the military establishment that will do all it can to preserve an economic empire including factories, land holdings and petrol stations.
A Brotherhood president, he said, would be best qualified to withstand the pressure and undertake the reform needed to foster a democratic system and revive Egypt's economic fortunes - goals at the heart of the "renaissance with an Islamic foundation" outlined by the Brotherhood's manifesto.
"Even if the president comes from the Brotherhood, the military council will continue to cling to power, but its chances will be lower," he said.
Were the Brotherhood to fail in its presidential bid, Ezzat said the group could be frozen out of government - an unusually candid assessment and one that runs contrary to more upbeat assessments from other figures in the group.
"I think they will offer some ministries which in their view will not have influence on deciding the general policies of state. We will say to them: 'Ok, fine, we will go into opposition,'" he said, casting his eye down the road to local elections later this year as the next opportunity for the group boost its representation.
In his mid-60s, Ezzat is a Brotherhood veteran who was first jailed in the Nasser era. He carries the same rank as Khairat al-Shater, the man who was the Brotherhood's first-choice candidate for the presidency but was disqualified because of a criminal conviction he received during Mubarak's rule.
Ezzat has spent less time in the public eye than other Brotherhood leaders and has been cast as the group's "iron man" by local media: a figure who has come to personify the Brotherhood's reputation for tough internal discipline and top-down decision making.
Ezzat dismisses that moniker as the invention of an ill-informed and hostile media. The Brotherhood has only been able to succeed by convincing its followers of its ideas, not ordering them around, he said.
Yet the label points to the broader image problem facing the Brotherhood, which has lost a degree of the support it once enjoyed in the rough and tumble of Egypt's new politics.
'Your insults make us stronger'
Critics list mistakes, including a failure to adequately engage other forces in society in the post-uprising period.
The group has been depicted as power-hungry and seeking to squeeze others out of public life - assertions that it fiercely denies and which are a far cry from its former reputation as a victim of oppression.
There have been unfavorable comparisons with the Ennahda Party of Tunisia, an Islamist group also seeking to shape the future of a state in transition but which has been credited with maintaining better relations with others in society at large.
The criticism has drawn a defensive response from the movement. "Mock us! Swear at us! Your insults make us stronger," chanted Brotherhood activists during one rally this week, capturing a combative mood in the Brotherhood's ranks.
The Brotherhood believes its mix of politics, religion and social work is today more appealing than ever.
It has laid out its vision for governing the country in an 80-page document that touches on everything from investment to Islamic law and foreign policy that, among other elements, looks to deepen ties with other Muslim states including Turkey.
The Brotherhood, spurned by the United States during the Mubarak era, now regularly meets US officials. It envisages ties with Washington built on mutual respect and an end to "all forms of political, economic and military dependence."
On Israel, like others, the group has said it wants to review the 1979 peace treaty but that it will not tear it up.
The Brotherhood points to the 350,000 members who have joined the party it founded last year as a sign of unrivaled strength at home and has dismissed talk of internal splits as wishful thinking on the part of those who wish it ill.
Still, there has been internal criticism of the way it has conducted its own affairs since the uprising.
Hassan el-Bishbishi, part of the Brotherhood for 33 years and one of the 8,000 founding members of its Freedom and Justice Party, says the group needs to reform from within.
He resigned from the party over the group's decision to contest the presidency, saying more of its members should have been consulted ahead of such a historic step. "This small circle does not express the opinion of the Brotherhood masses," he told Reuters, referring to the advisory council that took the decision. He plans to vote for Abol Fotouh.
There has also been criticism of the group's approach from more senior Brotherhood figures. Helmi el-Gazzar, a Brotherhood MP who sits on its advisory council, believes the group should have done more to address the concerns of other parties.
One shortcoming was its attitude towards the formation of a body due to write Egypt's new constitution. The Brotherhood's critics say it exploited its parliamentary strength to push for a process that sidelined everyone other than Islamists. The whole process has been paralyzed by the dispute that ensued.
"I'd give them 6.5 out of 10," said Gazzar, scoring the Brotherhood's performance since Mubarak was toppled. But he added: "This is a good mark in troubling times."
Shadi Hamid, an expert on the Brotherhood at the Doha Brookings Center, said the group had failed to keep up with the times. "The Brotherhood is operating as if the revolution never happened. They haven't been able to adapt," he said.
But there are signs of self-reflection at the top.
Mursi, in a television interview, said the group had reviewed mistakes including its approach to the constitutional assembly. "We retreated and said that was a mistake," he said.
"There are many positive things but also some negatives which we are looking into, apologizing for and changing."