BAGHDAD — The serpentine career of Ayad Allawi, who served briefly as Iraq’s interim prime minister five years ago, has taken another unlikely turn: a secular Shiite with little taste for campaigning, he stands a strong chance of winning the most votes in Sunday’s parliamentary elections as the leader of a coalition that is attracting deep support from Sunni Muslims.

He has a history of blurring expected lines: Once a staunch Baathist, he survived an assassination attempt by ax ordered by Saddam Hussein and later developed deep ties to the Central Intelligence Agency. Now he is staging a surprising political comeback by pushing a secular and nationalist agenda that has made him the most formidable alternative to Prime Minister Nuri Kamal al-Maliki.

“Now is the time, my brothers, to achieve wide and genuine partnership in Iraq,” Mr. Allawi, 64, told a crowd of supporters at a rally this week in Baghdad.

His candidacy also pricks the nerve centers of some Iraqis nostalgic for the return of strong, even dictatorial, leaders. The myth around Mr. Allawi blossomed with a story that circulated in 2004 that he shot several detainees in a jail in suburban Baghdad while he was prime minister. Mr. Allawi has called the story “fiction,” but it has remained in the minds of some Iraqis — and not necessarily as a bad thing.

“To us, Allawi is a second Saddam Hussein,” said Abu Sara Ahmed, 35, speaking on a street corner in Karada, an upper-middle-class Baghdad neighborhood. “The Iraqi people are always in need of someone who can bring fear and respect for authority.

“We don’t want someone who is afraid to kill, someone who is a coward. You have to kill a criminal; you can’t just put him in prison.”

For Mr. Allawi, a survivor of numerous assassination attempts, the rally this week, which drew a crowd of a few thousand, Sunni and Shiite alike, was the first major one held outdoors for his Iraqiya coalition, just four days before Sunday’s elections.

The event was an exuberant showing of support. Speeches were punctuated by chants from the crowd of “Triumph, Baghdad!” — the words from a famous Arab song dating from the Iran-Iraq war in the 1980s.

Mr. Allawi, preaching a nationalist agenda that he hopes can unite the country’s various sects and tribes, told the crowd: “There is no difference between a Kurd, an Arab, a Turkmen. There is no difference between a Muslim or a non-Muslim. There is no difference between a Sunni or a Shiite.”

While sectarian violence is down substantially from a few years ago, it has picked up in the period before the election. As Mr. Allawi’s rally was under way, three car bombs struck Baquba, the capital of Diyala Province, north of Baghdad, killing 33 people.

At one point, Mr. Allawi was interrupted by a man in the crowd who yelled, “We will sacrifice our blood, our souls for you, Allawi!”

The rally was described by Fatah al-Shaikh, a candidate and the editor of a newspaper affiliated with the radical cleric Moktada al-Sadr, as “a meeting of the leader with the masses, face to face, far from armored vehicles and bodyguards.”

Yet an armored Iraqi Humvee was close by, soldiers with AK-47s patrolled the crowd, and a soldier was stationed on the roof of Mr. Allawi’s home, peering at the crowd from behind the barrel of a machine gun.

Polls conducted on behalf of independent organizations and American officials, which have not been released publicly, show that Mr. Allawi enjoys more approval nationwide than Mr. Maliki, although his support appears tepid: more supporters of Mr. Allawi say they could yet change their mind.

On the evening before the rally, on the streets of Adhamiya, a Sunni neighborhood that was once one of Baghdad’s most dangerous areas and a staging ground for militants, Mr. Allawi’s support among residents was stark evidence of the progress Iraq has made in quelling the vicious sectarian violence of a few years ago. The neighborhood was once deemed so dangerous that the American military built a wall around it.

“I decided to vote for the Allawi list because he was prime minister for six months, and we found him to be a good person,” said Yasir Ayad, 29, an Adhamiya resident.

Sunnis in this country fear that the planned withdrawal of American troops, scheduled to begin in earnest after the elections, could increase sectarian violence. The government’s disqualification of many Sunni candidates as Baathists, and its failure to prevent several major bomb blasts, have cut into Mr. Maliki’s Sunni support.

Sunnis also cite the widespread belief that Mr. Maliki, a Shiite, is loyal to Iran, which like Iraq is majority Shiite.

“An Iraqi won’t blow himself up,” said Haidir Hamid, another Adhamiya resident. “Half of the government right now is loyal to the Iranian government.”

Mr. Allawi has positioned himself as an Arab leader who can work with regional governments. He recently visited Saudi Arabia, Syria and Lebanon, trips that unnerved some in Iraq, where worries over foreign influence fester. On Thursday, the day after the rally, Mr. Allawi visited Damascus, the Syrian capital.

After the Americans returned sovereignty to Iraq in 2004, Mr. Allawi was the interim prime minister. But in the 2005 parliamentary elections, the last nationwide vote before Sunday’s contests, Mr. Allawi fared poorly. His coalition won just 25 seats, or 9 percent, in the 2005 election.

But Mr. Allawi showed signs of a political comeback in last year’s provincial elections. In Salahuddin Province, which is majority Sunni, Mr. Allawi’s Iraqi National List won a plurality of votes.

In January, with Mr. Maliki appearing weak after the de-Baathification dispute, Mr. Allawi announced the formation of Iraqiya, an effort he had been building for months. It is now the main rival to the current government’s coalition, State of Law.

Mr. Allawi’s alliance includes Vice President Tariq al-Hashimi. It has also included a leading Sunni lawmaker, Saleh al-Mutlaq, who was barred from running because of previous ties to the Baath Party.

While in exile during the 1980s and 1990s, Mr. Allawi worked with the C.I.A. to undermine Saddam Hussein’s government, in operations that included undertaking acts of sabotage, according to former intelligence agents.

Despite his reputation as a strong leader, Mr. Allawi is criticized as failing to campaign hard enough.

With four days to go before the election, Maysoon al-Damluji, a spokeswoman for Mr. Allawi’s Iraqiya coalition and a candidate herself, stood in the backyard of Mr. Allawi’s home after the rally.

When asked if there would be more rallies for Mr. Allawi like the one just ended, she said, “I’m not sure.”

Anthony Shadid and Sa’ad al-Izzi contributed reporting.