By Frank Simon
GELNHAUSEN, Germany (Reuters) - German Chancellor Angela Merkel was booed and whistled at by supporters of the anti-immigrant Alternative for Germany (AfD) at a campaign rally on Monday as she sought to persuade voters to grant her a fourth term in next month's election.
A group of around 100 AfD supporters, some of them wearing stickers with the party's logo and carrying posters with slogans such as "Immigration needs clear rules", heckled Merkel throughout her 33-minute speech in a market square with quaint timber-framed buildings in the western town of Gelnhausen.
They chanted "AfD" and "Merkel needs to go" as the chancellor, recently returned from a three-week holiday, gave a speech that ranged across security, refugees, the economy and the diesel emissions scandal affecting Germany's car industry.
Merkel acknowledged the protesters at the rally around 40 km (25 miles) east of Frankfurt, saying Germany was a "democracy where people can show their discontent". But she added: "Sometimes listening a bit isn't a bad thing".
Some of her supporters carried posters featuring the black, red and gold colors of Germany's flag and the words "Angela Merkel" or "For a Germany in which we live well and happily" - the campaign slogan of her Christian Democrats (CDU).
Polls show Merkel's conservatives are set to emerge from the Sept. 24 election as the largest party by a long shot, but still in need of a coalition partner. The AfD is expected to enter the national parliament for the first time, polling 7-9 percent.
Merkel drew boos mixed with applause when she thanked volunteers and professionals who helped the 890,000 migrants and refugees who arrived in Germany in 2015 after her controversial decision to open the country's borders.
"Of course we can't allow a year like 2015 to recur every year," she said, adding that Germany needed to do more to tackle the root causes of migration, such as by encouraging development in Africa.
Campaigning on a platform of economic stability, Merkel highlighted the government's balanced budget and said unemployment had been halved in the 12 years since she took power.
She also stressed the importance of the European Union, currently embarking on negotiations over Britain's withdrawal.
"When I see that we have much that is very dear to us - freedom of religion, freedom of opinion, freedom of movement, democracy, respect for human values - then it is clear that Europe makes us stronger than we would be on our own," she said.
(Reporting by Reuters Television in Gelnhausen, additional reporting by Noah Barkin in Berlin, writing by Michelle Martin; Editing by Mark Trevelyan)