At least 13 people were killed in Iraq on Friday as tens of thousands defied an official curfew to join a nationwide “Day of Rage,” echoing protests that have roiled the Middle East and North Africa since January.

Despite pleas by the government and Shiite religious leaders for Iraqis to stay home, demonstrators gathered by the hundreds and thousands from Basra in the south to Mosul and Kirkuk in the north.

The protests were mostly peaceful but often angry, as Iraqis stormed at least three provincial offices and set fire to another. Fatalities were reported in Mosul, Tikrit and a town near Kirkuk after security personnel opened fire on the crowds.

Protesters vented their frustration at local officials as well as Prime Minister Nouri al-Maliki, demanding jobs, more electricity and clean water and better pensions and medical care. In the southern province of Basra, about 10,000 demonstrators forced the resignation of the provincial governor.

And as the sun began to set, protesters in Mosul, Tikrit and Ramadi were clashing with security forces, demanding that local officials step down. Security forces used tear gas, sound bombs and at times live bullets to disperse the crowds.

In Baghdad, where Maliki imposed a curfew that banned cars and even bicycles from the streets, people walked, often many miles, to reach the city’s Tahrir Square. Several thousand had gathered by early afternoon.

Surrounded by hundreds of police, soldiers and rooftop snipers, with military helicopters buzzing overhead, protesters waved Iraqi flags and signs reading “Bring the Light Back” (a reference to the lack of electricity), “No to Corruption!” and “I’m a Peaceful Man.”

Many said they were protesting for the first time. Among them was Selma Mikahil, 48, who defiantly waved a single 1,000-dinar bill in the air. “I want to see if Maliki can accept that I live on this!” she yelled, referring to her pension, the equivalent of $120 every five months. “I want to see if his conscience accepts this!”

Protesters circled the square and then surged down a road toward the bridge leading to Maliki’s offices, where a row of giant concrete blast walls had been erected overnight to block them. At one point, protesters began pushing against the walls, managing to open a crevice and push through. Witnesses said a soldier shot one protester in the stomach, and people began to hurl rocks over the wall after that.

Though demonstrators mostly called for reform and an end to corruption, there were calls here and there for Maliki to step down.

Many said they were shocked by the “indefinite” curfew on cars and bikes imposed late Thursday night, saying the government’s attempts to prevent them from demonstrating only motivated them more.

“The government is afraid of the nation!” said engineer Sbeeh Noman, who said he walked 12 miles to reach the square. “They have found out that the people have the real power. We have it.”

In Mosul, six people were killed and 21 injured after security guards opened fire on a large crowd gathered in front of the provincial council building to demand jobs and better services. Abdulwahid Ahmed, head of Al Salam Hospital, said all of the dead and injured had been shot. Black smoke could later be seen billowing from the government building, the Associated Press reported.

In Tikrit, four protesters were killed and 15 injured when security forces opened fire with live bullets on demonstrators gathered at provincial governor’s office. The crowd was demanding that detainees be released from prisons and chanting slogans against Maliki. “Get out! Get!” they yelled, as local authorities looked down on them from the building’s balconies.

At least three people died in Hawija, a mostly Arab town near the troubled northern city of Kirkuk, after police began shooting at a crowd of demonstrators who stormed the local council building. Maj. Abbas Mohammed al-Jibouri, a local security official, said the police were forced to withdraw and that demonstrators were in control of the area.

Protest organizers had hoped the nationwide demonstrations would inject a fresh concept into the exercise of Iraq’s fledgling democracy: peaceful expression of discontent. They insisted their goal was to demand a better government, not a new one.

But the days leading up to the protests were defined by anxiety and the increasingly familiar features of Maliki’s bare-knuckle governing style.

On Tuesday night, security forces ransacked Iraq’s nonprofit Journalistic Freedoms Observatory, which is supporting the protest, carting off computers, hard drives and files. On Wednesday, hundreds of soldiers and police began fortifying Tahrir Square, checking IDs and photographing the smattering of protesters who had begun unfurling banners reading “No to bribes!” and “The oil money is for the people!”

Maliki, who had begun the week welcoming the protest, urged people in a televised speech Thursday to stay away. He said the event seemed “suspicious” and was likely to be infiltrated by al-Qaeda or perhaps loyalists of Saddam Hussein’s Baath Party or “terrorists” seeking to co-opt it for their own purposes.

Soldiers set up checkpoints blockading many Baghdad neighborhoods. Near midnight Thursday, a red banner flashed across state television broadcasts announcing the curfew, a draconian measure more often deployed to deal with insurgent attacks.

Still, many of the young protesters said they were undeterred, and proved it by walking for hours to get to the protest sites.

“If they want to get rid of our demonstration, then let them do reforms,” Ziad al-Ajeeli, director of the press group that was raided, said Thursday. “This is a new concept. Previously, people thought you had to change things with weapons. Now we want to change things through our ideas. We want Iraqi society to be a civil society.”

But perhaps the biggest blow to the planned protest came from the Shiite cleric Moqtada al-Sadr, one of the few Iraqi leaders able to command hundreds of thousands of followers into the streets.

Returning to Iraq from Iran on Wednesday, Sadr issued a careful statement welcoming peaceful protests but urged his devotees to delay participating for six months, to give the government more time to address widespread complaints. Once one of the government’s main enemies, the fiercely anti-American cleric is now part of Maliki’s fragile governing coalition, and analysts speculate that he would rather not see it collapse, at least not now.

The cleric’s move “will have the intended effect of calming things down,” said Joost Hiltermann, Middle East program director for the International Crisis Group. “The question remains what others will do — the secular young in Baghdad and elsewhere.”

At least five protesters have been killed in clashes with security forces during recent demonstrations across the country, each featuring similar demands: more access to electricity and clean water and an end to corruption. The protests were partly inspired by the peaceful revolution that toppled Egyptian President Hosni Mubarak.

In some cases, protesters have thrown rocks and set government buildings on fire. Demonstrations against an entrenched political elite in normally peaceful Kurdistan have numbered in the thousands.

A special correspondent in Kirkuk contributed to this report.