Police fought pitched battles with the workers to evict them
A 77-day occupation of a car plant by hundreds of laid-off workers in South Korea has come to an end, a company manager has told the BBC.
A deal was struck between the union and car maker Ssangyong to keep about half of the workers staging the occupation on the firm's staff, reports have said.
Nearly 100 people were injured in clashes as police tried to evict about 500 workers from the plant.
The struggling firm wanted to cut about 2,600 workers, 36% of its total staff.
More than 1,600 workers agreed to take voluntary redundancy, but the remaining 1,000 objected, with many barricading themselves into Ssangyong's main factory at Pyeongtaek, 70km (43 miles) south of Seoul.
John Sudworth, BBC News, Pyeongtaek
Some observers point out that South Korea's trade union movement needs to be so strong because the welfare system is so weak compared with other wealthy economies.
Jobs, the argument goes, are worth fighting for.
But few people believe the scenes at Ssangyong over the past few weeks have been in anyone's interest, least of all the thousands of workers who were not facing the sack and wanted to get the production lines running again.
The dispute, the company says, has cost it more than $250m (£150m), and its future was already far from assured.
After talks between the union and management broke down on Sunday, police commandos fought pitched battles with the workers and sprayed tear gas from helicopters, trying to evict the workers.
The workers defended their position using giant home-made catapults and firebombs.
At one point a team of commandos were dropped onto the roof of the occupied building to engage in hand-to-hand combat with the strikers.
Details of the agreement to end the occupation remain unclear, but what is certain is that it has taken a toll on the small South Korean car maker, says the BBC's John Sudworth in Pyeongtaek.
The dispute started when the cash-strapped company, already in court receivership, announced major layoffs in a bid to restructure.
Now that an agreement has been reached, the factory has been inspected. The management says there is remarkably little damage and can begin operating again soon.