BRUSSELS, Feb 28 (Reuters) - The European Union is preparing to grant Ukrainians who flee the war the right to stay and work in the 27-nation bloc for up to three years, senior EU and French officials said.

At least 300,000 Ukrainian refugees have entered the EU so far, and the bloc needs to prepare for millions more, they said. EU members Poland, Romania, Slovakia and Hungary have land borders with Ukraine.

"It is our duty to take in those who flee war," French Interior Minister Gerald Darmanin told France 2 TV on Monday, saying EU interior minister had on Sunday tasked the European Commission with preparing draft proposals to grant them protection.

Ministers will meet again on Thursday to agree on the details.

The EU temporary protection directive, drawn up after the 1990s war in the Balkans, but never used so far, provides for the same level of protection, for one to three years, in all EU states, including a residence permit, access to employment, social welfare and medical treatment.

EU Home Affairs Commissioner Ylva Johansson said most ministers had brought their support to the move on Sunday, with just some questioning if now was the time to do it or if it was best to wait a bit.

The issue, she said, concerns all of the EU.

"We already see a lot of Ukrainians leaving the countries of first entry and go to other member states, especially those that have a big Ukrainian population already," she told a news conference on Sunday. "Poland is one of them but also Italy, Portugal, Spain, Germany, the Czech Republic."

"All EU member states are prepared to accept refugees from Ukraine," German Interior Minister Nancy Faeser said.

"This is a strong response by Europe to the terrible suffering that Putin inflicts with his criminal war of aggression: Together, we stand in solidarity with the people of Ukraine."

Citing U.N. estimates, Janez Lenarcic, European Commissioner for Humanitarian Aid and Crisis Management, said four million Ukrainians are expected to flee the country as refugees.

With men of conscription age prevented from leaving Ukraine, mostly women and children are arriving at the border in eastern Poland, Slovakia and Hungary and in northern and northeastern Romania.