BAGHDAD - Thousands rallied across Baghdad and elsewhere in Iraq on Friday in anti-government demonstrations that defied security checkpoints and a vehicle ban that forced many to walk for hours to the heart of the capital.

It was the second Friday in a row of Iraqi demonstrations -- a show of force that has unnerved Prime Minister Nouri al-Maliki's government, which is worried that the turmoil in the rest of the region is spreading here. Most of the protests were peaceful, but police used water cannons against demonstrators in the southern port city of Basra and beat some journalists who were covering the demonstrations.

The rallies, inspired by revolutions in Egypt and Tunisia, concentrated on demands for improved government services, better pay and an end to corruption in Iraq. They also reflected the level of unhappiness many Iraqis feel nearly eight years after Saddam Hussein's ouster.

"Our country is lost and for the last eight years the government has failed to offer services for people. Thousands of youths are without jobs," said Bahjat Talib, one of about 2,000 demonstrators in and around Liberation Square, surrounded by hundreds of security personnel.

Talib said he passed through eight checkpoints to get to the square, telling security forces he was going to work because otherwise they would not let him pass.

The Iraqi government took strict measures that appeared to be designed to limit the number of demonstrators. Late Thursday, they barred vehicles from the streets, so many of the protesters walked for miles. Vehicles were also banned in at least 10 cities across Iraq.

Hana Adwar, an Iraqi political activist, said she'd received several calls from friends who had been prevented by security forces from getting to the square.

Protesters held demonstrations in different locations across the capital. Hundreds rallied in western Baghdad's Mansour neighbourhood and in two neighbourhoods in southeastern Baghdad. And in the Sunni neighbourhood of Azamiyah, hundreds of people gathered in front of the revered Abu Hanifa mosque after prayers, shouting: "Liar, liar, Nouri al-Maliki is a liar!"

Thousands of people rallied in Sadr City to voice solidarity with people in Libya. But the turnout -- some witnesses put it as high 10,000 -- underlined the power of anti-American cleric Muqtada al-Sadr, whose power base is in Sadr City.

Al-Sadr and al-Maliki are allies in the government, but signs of a rift have developed with al-Sadr voicing displeasure with the way al-Maliki has been handling the wave of protests.

At Liberation Square, side streets were blocked with security vehicles and helicopters buzzed overhead. The bridge leading from the square to the Green Zone, home to the U.S. Embassy and the prime minister's residence, was blocked off with razor wire and concrete barriers.

A long row of riot police prevented protesters from crossing the bridge. By late afternoon, the demonstrators had largely dispersed and the vehicle ban was lifted.

The bridge was the site of repeated clashes last Friday between protesters who threw rocks at the security forces who hurled the stones back and beat them with batons.

It was one of many clashes last Friday between security forces and protesters in the most widespread and violent demonstrations the country has seen since unrest began spreading across the Middle East. At least 14 people were killed, raising questions about the use of force by Iraqi security officials.

Both U.S. and U.N. officials earlier this week said they were disturbed by reports of abuse of force by security personnel against journalists and activists.

Before those protests, Iraqi officials sounded a drumbeat of warnings about the demonstrations, saying they were being backed by supporters of Saddam and al Qaeda. The warnings seemed designed to keep people away and paint in a bad light those who did take part.

The Iraqi government appeared to back off ahead of this week's demonstrations, trying instead to focus on measures being taken to improve people's lives. Al-Maliki has called for early provincial elections and has given his ministers a 100-day deadline to improve their performance.

Still, demonstrators on Friday took measures to protect themselves. Kamil al-Assadi, from Sadr city, formed a committee checking demonstrators entering the square because they were worried the security forces might plant people in the crowd to create problems.

"We do not trust the Iraqi security forces," he said.

In Basra, about 1,000 people converged on the provincial council building. Last week, the protests in the city led to the resignation of the governor. This week protesters were demanding that the provincial council step down and essential services such as water and electricity be improved.

Demonstrations were also held in Mosul, Tikrit, Sulaimaniyah, Nasiriyah and Amarah.