Baghdad (AFP) - Iraq's sharply divided parliament elected a speaker Tuesday in a step forward in the delayed government formation process, as a renewed bid to recapture Tikrit from militants ended in retreat.

World powers and Iraq's top Shiite cleric, Grand Ayatollah Ali al-Sistani, have piled pressure on MPs to set aside their differences in the face of a jihadist-led offensive that has overrun swathes of territory north and west of Baghdad.

After two fruitless sessions earlier this month, MPs elected Salim al-Juburi as speaker, a post traditionally held by a Sunni Arab that must be filled before the process of forming a government can go ahead.

US Secretary of State John Kerry swiftly congratulated Iraqi leaders and urged a rapid follow-up.

"The election of a speaker is the first step in the critical process of forming a new government that can take into account the rights, aspirations, and legitimate concerns of all Iraq's communities," he said in a statement.

"We urge Iraq's leaders to follow this achievement with rapid formation of a new government pursuant to Iraq's constitutional timelines."

It was not immediately clear if Juburi's election was part of a package deal also involving the posts of president and prime minister.

Lawmakers must now elect a president, who will then give the biggest bloc the first chance to form a government.

In a sign of possible divisions within the dominant Shiite alliance, two rival candidates stood for the post of first deputy speaker.

Juburi announced in televised remarks that candidacies for president must be submitted within three days, and said parliament will next meet on July 23.

UN Iraq envoy Nickolay Mladenov, who has repeatedly called on politicians to make progress, said that "an important step was taken in restarting the democratic process in Iraq."

- Tikrit withdrawal -

Earlier on Tuesday, security forces launched an attack on Tikrit, hometown of executed dictator Saddam Hussein, aiming to revitalise a counter-offensive that began more than two weeks ago.

They initially gained control of the southern part of the city, but later pulled back south of Tikrit after heavy fighting, officers and witnesses said.

"Iraqi forces withdrew at the beginning of the night so that they would not be exposed to losses," but would return later, a senior army officer said.

However, any gains made in the city are likely to be offset by militants moving back in.

Things went better in Dhuluiyah, 80 kilometres (50 miles) north of Baghdad, where tribesmen and security forces succeeded in driving out militants after days of heavy clashes, a tribal fighter and a police officer said.

It is the second time that militants have been expelled from the town in recent weeks.

Jessica Lewis, a former US army intelligence officer who is now research director at the Institute for the Study of War, said the capture of Dhuluiyah could allow militants to isolate Samarra, a key city to the northwest.

They could also have used the town as a staging post for attacks on major military bases, the neutralisation of which would "compromise the strategic defence of Baghdad from the north".

Violence struck other areas on Tuesday, with attacks including two car bombs in Baghdad killing at least 27 people.

The fighting and bombings came a day after the Pentagon said US military teams sent to Iraq last month had completed their assessment of Iraqi security forces.

The details were not publicly released, but The New York Times reported that one conclusion was that only roughly half of Iraq's units are capable enough to be advised by US personnel, if the decision is taken to do so.

- Deep divisions -

Though parliament has finally made progress, deep divisions remain over key appointments and other issues.

Ties between the Baghdad government and Iraq's autonomous Kurdish region have hit a new low, and Maliki has pledged to seek a third term despite some lawmakers and the Kurds demanding he step aside.

Kurdish leaders have taken advantage of the collapse of federal security forces across northern and north-central Iraq to take control of a swathe of historically Kurdish-majority territory outside their autonomous region in the north.

Kurdish regional president Massud Barzani has called for a referendum on independence for the expanded region.

Maliki, a Shiite Arab viewed by opponents as a divisive and sectarian leader, has refused to quit.