WARSAW, Feb 27 (Reuters) - Polish Prime Minister Donald Tusk said on Tuesday he could not rule out widening a national ban on imports of Ukrainian grains to other products if the European Union does not act to protect the bloc's markets.

Tusk made the remarks during a visit to Prague as thousands of Polish farmers took to the streets of Warsaw, carrying the national flag and blowing handheld horns, escalating a protest against food imports from Ukraine and EU green rules.

Farmers across Europe have been protesting for weeks against constraints placed on them by the EU's "Green Deal" regulations meant to tackle climate change, as well as rising costs and what they say is unfair competition from outside the EU, particularly Ukraine.

The EU in 2022 waived duties on Ukrainian food imports following Russia's invasion of Ukraine.

Poland last year extended a ban on Ukrainian grain imports.

"We are talking about it with the Ukrainian side - that it will be necessary to expand the embargo to other products if the European Union does not find more effective ways to protect the European and Polish markets," Tusk said on Tuesday.

Polish Agriculture Minister Czeslaw Siekierski said in a Tuesday evening interview on Polsat News TV that further talks with Ukraine on solutions were planned for Wednesday and various possibilities were being considered.

"Tomorrow we will also talk about it with Ukraine's minister of economy, who will be a guest at the Ministry of Development and New Technologies," he said, adding that he would be participating.

He said Polish farmers were invited to the agriculture ministry for talks on Thursday.

Speaking after Siekierski on Polsat News, protest organiser Szczepan Wojcik said the invitation was welcome, but warned of more protests if no progress was made during the next few days.

"Further protests in Warsaw have already been announced for March 6. Farmers are already organising on the roads, and border crossings will continue to be blocked," he said.

Asked about the possibility of further escalation, Wojcik said, "The farmers are desperate. ... The ball is in the government's court."

Earlier in the day, Tusk said the EU had to solve the problems created by its decision to open its borders to imports of Ukrainian food products.

He added that Poland was ready to co-finance purchases of Polish, European and Ukrainian food and agricultural products to be sent as humanitarian aid to famine-stricken countries, and that "Europe should certainly find funds for this."

Back home, farmers rallied in central Warsaw before marching towards parliament and then Tusk's office. A city hall official cited by PAP state news agency put the number of protesters around 10,000.

"We are protesting because we want the 'green deal' to be lifted, as it will lead our farms to bankruptcy with its costs...that are not comparable to what we harvest and to what we are paid," said Kamil Wojciechowski, 31, a farmer from Izbica Kujawska in central Poland.

"What we're paid for our work, it has decreased because of the influx of grain from Ukraine and this is our second demand - to block the influx of grain from Ukraine," he said.

The farmers began a series of protests throughout the country earlier this month, which included a near-total blockade of all Ukrainian border crossings, as well as disruptions at ports and on roads nationwide.

"We won't give up. We have no choice. Our farms will go bankrupt, we will lose our livelihoods," Pawel Walkowiak, 47, a corn and wheat producer from Konarzewo in western Poland, said.

The city hall official said Tuesday's protest in Warsaw took place without major incidents.

Photo from Reuters