BAGHDAD — The victory by the former Iraqi prime minister Ayad Allawi in the national parliamentary elections was received everywhere as a surprise, which in a way, of course, it was. But when you look closer at his campaign in comparison with that of the man he defeated, Prime Minister Nuri Kamal al-Maliki, it doesn’t look like a surprise at all.

The heart of Mr. Allawi’s popularity is that he is totally secular. This fact is important for many Iraqis after the catastrophes of the sectarian war of 2006-7.

Mr. Maliki is not a secular leader yet. He is a half-secular and half-sectarian Shiite Islamist. Many secular Shiites — if not all of them — voted for Mr. Allawi, even though he was identified as the candidate of choice for Iraq’s Sunnis.

“Allawi’s victory is a major indication for the change of the Iraqi people’s mood over the use of religion in politics,” said Dr. Hazim al-Nuaimi, a political analyst in Baghdad. “Iraqis are fed up with the ideological religious parties.”

The West

Mr. Allawi also enjoys better relations with the United States, Britain and the West in general. After all, he was appointed interim prime minister by the Americans in 2004. His movement had the best relations with the State Department, the British Foreign Office and the two countries’ intelligence communities.

“Allawi has historical relations with both the Americans and the British,” said Ahmed Abdul Hussein, a well known Iraqi writer who was the editor in chief for several Iraqi newspapers. “Despite the clear decline of the American role in Iraq, the Americans are trying to perform the role of the honest judge in Iraqi politics.”

The Arab World

Mr. Allawi also has better relations with Iraq’s Arab neighbors. His movement was established in Saudi Arabia, where he still has excellent contacts. (Indeed his opponents accuse him of being financed by such outsiders.) His movement operated in Jordan in the 1990s, and his relations with Turkey, Egypt and Syria are also very good. He had bad relations with Iran, but managed to repair them after approaching the Iranians in Baghdad and Tehran in recent months. Mr. Maliki, by contrast, has bad relations with many Arab countries, including Saudi Arabia.

“Allawi knows that the prime minister must be Shiite and that Arabs will not object to a secular non-sectarian Shiite like him,” said Dr. Ghassan al-Attiya, an Iraqi political analyst based in London. “He knows also that if Iran objects to his premiership, he will never assume power. So he has sent many positive messages to the Iranians.”

The Media

Mr. Allawi has much better relations with Iraqi, Arab and Western news agencies than his opponent. The satellite channel Al Sharqiya — one of the best Iraqi channels in terms of technical performance — was banned by Mr. Maliki. It has endorsed Mr. Allawi. The Saudi-financed station Al Arabiya — one of the best Arab channels — did the same for Mr. Allawi.

Reporters for Western news outlets have to wait for hours to get into one of Mr. Maliki’s news conferences, and he has launched a very aggressive campaign against what he calls the “poisonous media.” By contrast, reporters are able to interview Mr. Allawi with one telephone call.

“Allawi has much better P.R. skills — including speaking English — than Maliki ,who has called some Iraqi Web sites and blogs “garbage rooms,” Mr. Abdul Hussein, the editor, said.

Revenge and Reconciliation

While Mr. Maliki, the most prominent member of the Dawa Party, represents the victims of Saddam’s oppression — they see him as the man who will give them justice and revenge — Mr. Allawi is a former member of Saddam’s Baath Party, is himself a victim of Saddam’s policies, and represents reconciliation between the eras. Mr. Maliki has recently launched another aggressive campaign against the Baathists, accusing them of plotting the deadly bombings in Baghdad in the second half of 2009.

These attacks, which claimed about 500 lives, were a major reason for Mr. Maliki’s loss of popularity.

While Mr. Maliki tried hard to win more Sunnis to his State of Law alliance, Mr. Allawi was the one who managed to attract most of the Sunni leaders and parties. Saleh al-Mutlaq, Tariq al-Hashimi and Osama al-Nujaifi, among others, joined his Iraqiya alliance and accepted the fact that he is their candidate for prime minister.

“Mr. Allawi managed to win 85 percent of the votes of Sunnis, who preferred his secularism over the failure of the sectarian Sunni parties,” said Ibrahim al-Sumaidaei, a political analyst based in Baghdad.

Allies

While Mr. Maliki has lost most of his previous allies, such as the Kurds, the Islamic Supreme Council of Iraq and the Sadrist movement, Mr. Allawi was able to attract at least some of them to the idea of his leadership. Even many of his fellow Shiites have rejected Mr. Maliki’s attempt to have another term in office.

“We had negative experiences with Maliki,” said Dr. Mahmoud Othman, a Kurdish member of Parliament. “On the other hand, we have very good relations with Allawi.”

Despite the intense disagreement with the Kurds, Mr. Maliki was not able to form a real practical political challenge to the Kurds in the oil-rich province of Kirkuk. Mr. Allawi did so. After managing to unite the Arabs and the Turkmens with Turkey’s blessing, it was the first time a non-Kurdish political bloc won most of the votes in any election in Kirkuk since the American invasion of 2003.

Kirkuk’s election result, with Mr. Allawi taking six seats and the Kurds six, was a very unhappy development for the Kurds.

Riyadh Mohammed is an Iraqi journalist who works for The New York Times in Baghdad. For reaction in Baghdad see Tim Arango’s tour of the capital’s varied neighborhoods: ‘Celebrations and Protests’. In the rest of the country, our Iraqi correspondents have sampled opinions from the regions.