You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Citing security fears, authorities shut parts of the city's public transport system, erected steel barricades and deployed thousands of riot police to block access to Taksim, a traditional union rallying point and the focus of weeks of anti-government protests last summer.
Erdogan, who warned last week he would not let labour unions march on Taksim, has cast both last year's street protests and a corruption scandal dogging his government since December as part of a plot to undermine him.
While it was the unions who called for demonstrations to press workers' rights and express broad opposition to Erdogan's government, some of those who clashed more violently with police were from marginal leftist groups.
The Istanbul governor's office said it had received advanced information that "illegal terror organisations and their extensions" would resort to violence to stoke unrest.
On the fringes of a massive security cordon around the square, pockets of protesters played cat and mouse with police in tear gas-shrouded side streets.
Demonstrators in surrounding neighbourhoods repeatedly tried to breach police lines blocking the way to Taksim, a normally teeming shopping and tourism district which lay virtually deserted and ringed by security checkpoints.
Bemused tourists, their hotels lining the square, picked their way nervously through police lines, some shepherded by bell boys, their luggage in tow.
The Istanbul governor's office said 90 people were injured, 19 of them police officers, and 142 detained in the unrest, much of which took place early in the day with calm largely returning by the evening. It said police had found eight home-made bombs.
In the working class Okmeydani district, members of leftist groups threw fire bombs and fireworks at security forces, who responded with rubber pellets. Similar clashes erupted in March at the funeral of teenager Berkin Elvan, who had lain in a coma after being wounded in last year's unrest.
Elvan's image was displayed on a giant poster on Thursday as some of the protesters chanted "Berkin's murderer" at police.
"This is a day of struggle. We're not trying to reach Taksim to celebrate but to resist," said Caglar, 37, a teacher and leftist activist, clutching a scarf to protect against the gas.
Police also used water cannon and gas to disperse more than a thousand demonstrators in the capital Ankara, where the centre of the city was on lockdown, with a heavy security presence and police helicopters buzzing overhead.
After Erdogan's warning against trying to march on Taksim, the government suggested instead that the May Day gathering should take place at a venue on the outskirts of the city. The unions rejected that idea.
"We will be in Taksim despite the irrational and illegal ban. All roads will lead to Taksim on May Day, and our struggle for labour, equality, freedom, justice and peace will continue," the main unions said in a statement ahead of the day of protest.
On the main Istiklal shopping street leading to Taksim, hundreds of police, some in plain clothes, others in riot gear, sat outside shuttered shops. Tourists were searched by police as they tried to enter the area, normally one of the busiest in the city of 15 million people.
"This is supposed to be a friendly place for tourists. This is a terrible way to treat visitors," said Mustafa, from Cairo.
The authorities issued a similar ban last year, leading to thousands of anti-government protesters fighting with police as they tried to breach barricades around the huge square, which in previous years was a focal point for labour demonstrations.
That violence was followed by mass protests that spread across Turkey late last May, in one of the biggest challenges to Erdogan's rule since his AK Party came to power in 2002.
"Give up your hope of Taksim," Erdogan said at a meeting of his ruling AK Party lawmakers in parliament last week.
The prime minister has in the past dismissed protesters as "riff-raff" and "terrorists" and pointed to his AK Party's strong showing in elections.
The AK Party dominated the electoral map in municipal polls on March 30, retaining control of both Istanbul and Ankara despite the corruption scandal and last summer's unrest.