Office workers in business suits chant anti-government slogans alongside pious women wearing Muslim headscarves. Schoolchildren and bearded anarchists rub shoulders with football fans, well-heeled women in designer sunglasses and elderly couples donating food.

These disparate groups are united by alarm at what they consider unwarranted meddling and increasingly autocratic behavior by Recep Tayyip Erdogan, Turkey’s most popular prime minister in decades. Even some of his supporters are joining the protests sweeping Turkey.

On Wednesday, thousands thronged Istanbul’s central Taksim Square for a sixth straight day. Violent clashes broke out in the capital, Ankara, where riot police used tear gas and water cannon to subdue protesters. Nearly 1,000 people have been injured and more than 3,300 people detained since Friday, according to the Ankara-based Human Rights Association.

What started as an environmental outcry against plans to rip up trees in one of central Istanbul’s last green spaces to make way for a shopping mall has burgeoned into the most widespread unrest Turkey has seen in decades.

“For the first time, it’s everyone,” said Beste Yurekli, an 18-year-old high school student helping to clean up garbage in Taksim Square’s Gezi Park, where hundreds of demonstrators were camped out to try to prevent the bulldozers from moving in. “All of Turkey, we are united. We are one for the first time.”

The reasons, she said, are clear.

“It’s not just because of the trees. It’s because we’ve had enough of the government. He’s been acting like a dictator,” she said of Erdogan.

Since coming to power in 2002, the prime minister’s confidence has grown in tandem with his support, allowing him to win the 2011 election — his third consecutive victory — with nearly 50 percent of the vote. Although he has insisted his commitment to Turkey’s secular traditions is unwavering, the devoutly Muslim prime minister has moved to make religion increasingly prominent.

Erdogan draws his support mainly from Turkey’s large, predominantly rural, religious conservative base. In a country where the staunchly secular legacy of the modern state’s founding father, Mustafa Kemal Ataturk, has been zealously upheld, his rise to power was heralded as an end to the oppression of religious Muslims, who had been banned from overt displays of their faith, such as women wearing headscarves in universities.

But his increasingly frequent interventions into people’s private lives have disturbed many. Declaring that he wanted to raise a “generation” of pious youths, he has railed against couples kissing on public transport, sternly advised women to have at least three children and moved to curtail the sale of alcohol and ban its advertising.

With each proclamation, the modern, mainly urban population grew more alarmed. Even religious people began to chafe at what they considered unwarranted meddling in their private affairs.

“We were in Taksim Square to resist against the authoritarian governance, police violence and to protect our park,” said Fatma Dogan of the Anti-Capitalist Muslims, a civil initiative founded in 2001.

With his strong support base, the protests are unlikely to pose a serious threat to the survival of Erdogan’s government. But they could serve as a wake-up call that the prime minister cannot ignore the more than 50 percent of the electorate who did not vote for him.

“I am a defender of the freedom to sin,” columnist Mustafa Akyol wrote in the Hurriyet Daily News last week before the protests began. “What some people consider as sin, in other words, should not be banned by laws, unless the sins are also worthy of being objective crimes, with clear harm to others.”