The police believe refugees who are staging a protest outside the United Nations High Commissioner for Refugees' (UNHCR) offices in Pretoria are exercising their constitutional rights and that the gathering is not illegal.The national and provincial police commissioners have entered a court battle that seeks to remove the protesting refugees from the UNHCR's offices in Pretoria.They have been living on the pavements outside the offices since the beginning of October. Living in tents and makeshift structures, refugees are asking to be resettled in another country as they fear xenophobic attacks in South Africa.PICS | Refugees enter third week of sit-in protest outside UNHCR offices in PretoriaAn urgent application was brought by the Waterkloof Homeowners' Association and Brooklyn and Eastern Areas Citizens' Association seeking an order to direct the police to arrest and remove the refugees, who are cited as first respondents, for the contravention of different laws.The application also seeks to compel the City of Tshwane to enforce its by-laws and the Department of Home Affairs should ascertain the identifies of the refugees in order to find out their status in the country.The commissioners joined the court application as respondents as the two associations only cited the police minister who is not responsible for the day-to-day workings of law enforcement officers.Impractical remedy soughtIn an answering affidavit on behalf of the commissioners, Brooklyn police station commander Brigadier Kushandrie Pietersen, who is also a respondent, argued that the remedy sought, where the police were concerned, was impractical, incompetent and premature.Pietersen said the urgent application was rooted in the purported transgressions of the municipal by-laws by the refugees and that it was the function of the municipality to police the by-laws and regulations in question.READ: Refugee sit-in| national, provincial SAPS commissioners join court application for their removalThe police also argued that it was not within their mandate to ascertain the identities of the refugees, and that an order for them to do so was borne out of ignorance of the immigration laws.Citing the Immigration Act, the police said it was "patently clear that the Department of Home Affairs is the appropriate respondent, properly equipped" to determine the details and status of the refugees and that a person who was found to be in the country illegally should be arrested by immigration officers.Protest not illegalThey argued in court papers that the refugees' protest action was not illegal, therefore, they could not arrest refugees on that basis either."The police view the first respondents' gathering and/or demonstration as the exercise of their constitutional right to demonstrate freely and peacefully," Pietersen said in court papers."The police do not view the first respondents' conduct as trespassing, loitering and/or an illegal gathering."In terms of the Refugees Act, refugees enjoyed full legal protection which included the right set out in chapter two of the Constitution, the police added.Given that the court had not ruled on the application, the police could not not act as the refugees were not in contempt of a court order, they added.Proposed court orderWhile the police maintained that the court order sought by the applicants was incompetent in as far as it related to them, they have proposed an order that would end the impasse.News24 previously reported the application was deadlocked as none of the parties could reach an agreement on a way forward in terms of the court order.The City previously argued that issues relating to foreign nationals be dealt with at a political and diplomatic level before law enforcement agencies intervened.READ MORE: Court bid to remove refugees from upmarket Pretoria suburbs deadlockedIt further conceded it had a mandate to enforce by-laws, but that such by-laws would be inoperative in as far as they were in conflict with national legislation pertaining to refugees, asylum seekers and illegal immigrants.The Department of Home Affairs said it had difficulties to ascertain the identities of the refugees, as per the draft order.The police have proposed that the department should be dispatched to ascertain whether or not the refugees were in the country legally. If illegal immigrants were found, the department should arrest such persons on the spot, they added.The police will also consider a joint operation with the department if a plan is presented to them. We will not leave peacefully - refugeesThe refugees have already pre-empted the outcome of the application, saying they would not leave willingly.Democratic Republic of Congo (DRC) national Aline Bukuru, who has been a refugee in South Africa for the past 12 years, told News24 previously they were prepared for the worst possible order by the court.ALSO READ: 'Let them bring coffins' - Refugees camping outside UNHCR offices in Pretoria will not go willingly"We know the court is not here to protect refugees, so we are ready for anything. This happened in Cape Town already," Bukuru said, referring to refugees who were removed from the UNHCR's offices in Cape Town following a court order.Fellow DRC national Alex Mongo, who says he has been in South Africa since 2008, agreed with Bukuru."We don't have homes, we have nowhere to go. Let them bring the coffins, we are used to violence, we are used to attacks," he said.