THESSALONIKI, Greece – Greece’s prime minister promised Saturday to lower corporate taxes to help revive the debt-plagued country’s shrinking economy, while thousands of protesters marched — mostly peacefully — against the government’s harsh austerity measures.

Greece narrowly avoided bankruptcy in May when European countries and the International Monetary Fund gave it $140 billion through 2012 in emergency loans. The money came on condition Athens make deep cutbacks — moves that have angered unions.

Prime Minister George Papandreou said the tax rate on companies’ retained profits would be cut from 24 to 20 percent next year, providing what he called “a strong incentive for investments and competitiveness.”

He also pledged to open up restricted professions — including truck drivers, notaries, taxi drivers and pharmacists — deregulate the energy market, settle on privatization targets, facilitate major investments and simplify business licensing procedures by the end of this year.

Some 20,000 people gathered in three separate protests in the northern port city of Thessaloniki ahead of Papandreou’s speech. They were accompanied by some 4,500 police on security duty.

Minor clashes broke out as scores of youths attacked riot police with sticks, and were repelled with tear gas. No arrests or injuries were immediately reported. Police pre-emptively detained 20 people, including 13 from Spain, Italy, Britain and Portugal.

Previous protests have turned violent, and in May three people died in a bank torched by hooded youths who infiltrated a large demonstration in Athens — an action that shocked Greeks and deflated the protest movement.

Earlier Saturday, an elderly man threw a shoe at Papandreou, who had just inaugurated an annual trade fair. The projectile landed wide of its target, and the alleged shoe-thrower was arrested but later freed as Papandreou declined to press charges.

The center-left government says its daunting task of reducing the budget deficit from 13.6 percent of annual output in 2009 to 8.1 percent this year is on track, and has pledged to maintain the pace.

The transport ministry announced plans Friday to overhaul the state-run rail company — with debts of $13.62 billion– by cutting payrolls and rail services. About 40 percent of its 6,300 workers will leave and be offered other public sector jobs, while the company faces private competition.

Finance Minister George Papaconstantinou said Friday that reforms would extend to other state corporations.

But amid a deepening recession and high unemployment, unions are angry at this year’s deep spending cuts and consumer tax hikes, and fear new cutbacks. Heralding a new round of unrest, railway workers are planning strikes against payroll cuts, and some unionists have threatened to burn privately operated trains.

State revenue is increasing at a lower-than-projected rate, and the government has said it may have to increase sales tax rates on a broad range of goods, or raise heating fuel costs.

Papandreou vowed to crack down on rampant tax evasion, but at the same time said he would offer businesses the opportunity to settle tax disputes with the state out of court — and accelerate judicial procedures. Out of the estimated 400,000 cases pending in Greek courts, some 150,000 concern tax disputes.

Greek officials insist that together with the pain, the country’s worst postwar economic crisis will allow key reforms to the bloated, inefficient public sector and encourage a healthier development model.