By Michael Gold
TAIPEI, April 9 (Reuters) - Hundreds of student protesters filed out of Taiwan's parliament on Thursday after occupying the legislature for more than three weeks and vowed to press on with their campaign against a trade pact with Communist mainland China.
A crowd of thousands gathered outside the parliament to greet the demonstrators after they marched out in single file.
It was the largest anti-Beijing protest in years on the island, where Nationalists fled in 1949 after losing to the Communists in a civil war.
Shouting "defend democracy, repeal the trade pact!" the protesters pledged to continue their opposition to a services trade agreement which has been nearly approved by parliament.
"This movement is not over," Miles Lin, the leader of the sit-in told fellow protesters. "After leaving here, we're taking this movement out to broader Taiwan society."
Demonstrators, who carried sunflowers as a symbol of hope, said the trade pact will benefit wealthy companies with Chinese links and expressed fears it could lead to Chinese encroachments on Taiwan's cherished democratic institutions.
The demonstrators broke into the building in late March after the trade pact passed a crucial legislative hurdle and stood a single step away from full approval. Hundreds of protesters took turns occupying the building, repelling police efforts to evict them.
The demonstrations briefly turned violent after a separate group attempted to storm the government headquarters, leading to scuffles with police in which several people were injured. Hundreds of thousands later marched on the president's office.
On Monday, the protesters agreed to leave the legislature after the speaker promised that lawmakers would pass a review mechanism of all future China trade deals and proceed with a further review of the current pact.
Run as a dictatorship for decades after 1949, Taiwan developed democratic institutions from the 1980s and now has a lively legislature, free elections and a vibrant free press.
The pact would open 80 Chinese service sectors to Taiwan investment and 64 Taiwanese sectors to the mainland. Protesters were particularly angry about the opening of sensitive sectors like printing and advertising.
The pact's supporters view it as a necessary step in Taiwan's regional and global integration. President Ma Ying-jeou says it will create 12,000 jobs.
The controversy has led to calls for greater scrutiny of future trade deals.
"We're definitely going to be more cautious when we engage in goods trade agreements with China going forward," said Chang Chun-fu, Director General of Taiwan's Bureau of Foreign Trade. "We'll have to consult with industry more solidly than we had been." (Reporting by Michael Gold; Editing by Ron Popeski)