Brazil briefly closed then reopened its northern border to Venezuelans on Monday as it struggled to contain mass migration from the South American country saddled with a crippling political and economic crisis, police said. A Supreme Court justice overturned a lower court judge's decision that had suspended for a few hours the entry of more Venezuelans until other immigrants from the country were transferred elsewhere in Brazil. "It is not justified to take the easy path to 'close the doors' because of difficulties in hosting refugees," Supreme Court justice Rosa Weber said in her ruling issued shortly before midnight. The border had remained open to Brazilians and other nationalities, as well as to Venezuelans seeking to return to their home country. It's a main crossing point for tens of thousands of Venezuelan migrants, an influx that has increased dramatically over the past two years. President Michel Temer was opposed in a "non-negotiable" way to the border closure, Human Rights Minister Gustavo Rocha was quoted as saying by state-run Agencia Brasil. Roraima state's capital Boa Vista has hosted the largest number of Venezuelan immigrants in the country -- around 25,000 out of a total of 330,000 city dwellers. An estimated 500 Venezuelans cross the land border into Brazil each day. Roraima Governor Suely Campos had applauded the federal judge's ruling that temporarily shuttered the border. "We have been asking the federal Supreme Court since May to close the border, as well as for financial assistance to minimize the impact on our public services," Campos said in a statement. But Weber, the Supreme Court justice, said: "Although most of those who cross the border between Venezuela and Brazil do not fit into the legal definition of refugee or asylum. "Closing the border between the two countries could impact the situation of individuals who can qualify for protections under international law."