(Telecompaper) A federal judge in New York has ruled that the National Security Agency's phone-tracking programme is legal. US District Judge William Pauley issued the decision, saying the programme "represents the government's counter-punch" to eliminate al-Qaida's terror network by connecting fragmented communications, AP reports. In the ruling, the judge noted the September 11 terrorist attacks and how the phone data-collection system could have helped investigators connect the dots before the attacks occurred. He said the government learned from its mistake and "adapted to confront a new enemy: a terror network capable of orchestrating attacks across the world", and the data-collection programme was part of the adjustment. The ruling dismissed a lawsuit brought by the American Civil Liberties Union against the NSA programme. The ACLU said it plans to appeal.