(CNN) -- A top Ugandan official on Monday defended a decision to load hundreds of Rwandans in trucks and forcibly return them home in an operation condemned as illegal by the United Nations.
Police went to two refugee camps in southwestern Uganda at gunpoint last week and forcibly returned 1,700 asylum seekers back to Rwanda, the United Nations refugee agency said.
Two died after they jumped out of the trucks, according to the refugee agency. At least two dozens were injured, some from police beatings.
In one of the camps, Rwandans were lured into groups on pretext that they would get information on their asylum claims, said Melissa Fleming, a spokeswoman for the United Nations High Commissioner for Refugees.
"Panic spread among the group when police intervened, firing shots," Fleming said. "Force was used to push people onto trucks. They were then driven across the border to Rwanda, where they arrived the following morning."
Police went to another location and used food distribution as a pretext for the roundup, Fleming said.
"Once in the building, the group was surrounded by armed men and police. Those who did not manage to escape were forced onto waiting trucks. Many were not permitted to take their personal belongings with them," she said.
A Ugandan official decried the criticism and said the government followed proper procedure. Those deported were in the country illegally, said Musa Ecweru, the state minister for refugees.
"No refugee was deported. What we did is deport those who were taking advantage of our economy," Ecweru said. "These are people who did not qualify for asylum. We had to send them back to their country."
United Nations officials said while some had been denied asylum, others were in the middle of the process and should not have been returned home.
Ecweru said the Rwandan government was aware of the operation and supported it.
"Uganda has the most liberal refugee policy in the world and recognizes any refugee as a human being, and therefore we will be the last people to abuse refugees," he said. "Those we deported had been taking advantage of the floodgates and encroaching on land illegally."
The east African nation allocates land to refugees who have been granted asylum.
Those taking advantage of the "floodgates" to illegally get land will continue to be deported, Ecweru said.
Uganda has been taking in Rwandan refugees since the latter's genocide in 1994 that left at least 800,000 people dead.
"We have underlined that anyone deserving international protection be allowed to remain in Uganda," Fleming said.
Rwanda is scheduled to hold elections next month. Deadly grenade attacks have struck the capital, Kigali, and some newspapers have been shut down. A key opposition leader was found dead last week.
However, Ecweru said, the operation was not tied to the ballot.
"We have no interest in what happens in Rwanda," he said. "Of course we wish them a peaceful election, but this had nothing to do with that."
The deportations also have no connections to the bombings that killed 76 in the Ugandan capital of Kampala last week, the minister said.